在类似黑莓这样的设备中,我们是否有任何API方法(类似于DeviceInfo.isSimulator()
)来检查设备是模拟器还是真实设备?
在类似黑莓这样的设备中,我们是否有任何API方法(类似于DeviceInfo.isSimulator()
)来检查设备是模拟器还是真实设备?
由于内部常量似乎不时更改,因此没有一种100%正确的方法来执行此操作。 不过,这对我有效:
if (android.os.Build.MODEL.contains("google_sdk") ||
android.os.Build.MODEL.contains("Emulator")) {
// Then you are running the app on the emulator.
}