Reputation: 127
Like in Blackberry, do we have any API method (similar to DeviceInfo.isSimulator()
) to check if device is simulator or real device?
Upvotes: 3
Views: 4528
Reputation: 83303
There isn't a 100% correct way to do this since the internal constants seem to change every once in a while. This works for me though:
if (android.os.Build.MODEL.contains("google_sdk") ||
android.os.Build.MODEL.contains("Emulator")) {
// Then you are running the app on the emulator.
}
Upvotes: 1