Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if Windows Phone 8.1 app is running in the emulator?

In an 8.1 Universal app, is there an equivalent to:

if (Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator)
{
  // Emulator-specific code
}

I've looked and can't find a similar API.

like image 412
Brian Vallelunga Avatar asked Oct 20 '22 05:10

Brian Vallelunga


1 Answers

You could try something like this:

Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();

deviceInfo should give you info about SystemManufacturer ("Microsoft") & SystemProductName ("Virtual").

EDIT: I wrote a blog post about this problem.

like image 76
Igor Ralic Avatar answered Oct 30 '22 16:10

Igor Ralic