5

How to detect if a UWP/Iot Core application is being run on an ARM processor or a desktop processor (x86/x64)? Alternatively, is there any other way to detect if the application is run on desktop Windows or on a device? It would also help to detect if the application was launched in Visual Studio or not.

I already tried the Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation class but it does not provide this information.

Googling has not taken me further.

4
  • 2
    I haven't done nearly as much UWP development as I should have. I think this looks about right: suchan.cz/2015/08/uwp-quick-tip-getting-device-os-and-app-info . Could you take a quick look and confirm whether it's what you're after (specifically Package.Current.Id.Architecture.ToString())?
    – goobering
    Commented Oct 14, 2016 at 12:24
  • @goobering : thank you! You should have written that as an answer as it completely solved my problem!
    – Petri K
    Commented Oct 14, 2016 at 13:21
  • Note that this probably isn't as reliable as you want--some full-sized computers run ARM (Chromebooks, apparently some forthcoming blade servers), and Android can run on Atom. Commented Oct 14, 2016 at 21:59
  • @chrylis : thank you for the comment! In our case, we actually implemented the functionality with the OS family information also provided by the Package class (as suggested in the answer of @goobering). This is not about anything going to production, it is just to ease things to university students programming our device.
    – Petri K
    Commented Oct 16, 2016 at 10:26

1 Answer 1

10

This article on suchan.cz describes how to access several system details in a UWP application:

  • current OS family - phone/desktop/...
  • current OS build number - 10.0.10240.16413
  • current OS architecture - x86/x64/ARM
  • current App Display Name - Battery Tile for instance
  • current App Version - 3.0.2.0
  • current Device manufacturer - Nokia
  • current Device model - Lumia 1520

Specifically, the code used to access the system architecture is:

// get the package architecure
    Package package = Package.Current;
    string systemArchitecture = package.Id.Architecture.ToString();
1
  • Package is in namespace Windows.ApplicationModel
    – erict
    Commented Oct 31, 2019 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.