Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API call to check if running in emulator wp7

Is there a method I can call to see if I am currently running in the emulator vs. running on an actual physical phone?

I need to run some code a bit differently when I am in the emulator (I have a mock gps location service).

like image 261
BrokeMyLegBiking Avatar asked Nov 25 '10 03:11

BrokeMyLegBiking


People also ask

Can apps detect emulator?

There is no official API in iOS or Android to detect an emulator. Therefore, several proprietary checks have to be done by the RASP system.

How do I find my emulator on Windows 10?

The Windows 10 SDK and emulator can be installed as part of the Visual Studio installation. See the Visual Studio download page. You can also install the Microsoft Emulator for Windows 10 Mobile using the Microsoft Emulator setup.


2 Answers

You can get this from Microsoft.Devices.Environment.DeviceType

like image 182
Mick N Avatar answered Oct 16 '22 21:10

Mick N


if (System.Environment.DeviceType == DeviceType.Emulator)
{

}

Hope that helps

like image 21
Mugunth Avatar answered Oct 16 '22 20:10

Mugunth