问题
Hi I'm developing an android application an runed it on genymotion emulator , in this application i need the device IMEI but i always get a null value the same logic works with AVD emulator or android smartphone
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
IMEI = telephonyManager.getDeviceId();
with permission added to the manifest
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
回答1:
The .getdeviceID()
is not reliable and yes it returns null if its an emulator. i found a link that might help you. Like an alternative
Link 1
Link 2
Link 3
回答2:
Genymotion emulator doesn't have IMEI code as there was an IMEI code if it's a real phone. But you can still generate a fake code with some specific method.
来源:https://stackoverflow.com/questions/18408530/get-imei-in-genymotion-emulator