简体   繁体   English

在GenyMotion模拟器中获取IMEI

[英]Get IMEI in GenyMotion emulator

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 嗨,我正在开发一个android应用程序,并在genymotion模拟器上运行它,在此应用程序中,我需要设备IMEI,但我总是得到一个空值,同样的逻辑也可以在AVD模拟器或android智能手机上使用

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" />

The .getdeviceID() .getdeviceID()

is not reliable and yes it returns null if its an emulator. 是不可靠的,是的,如果它是模拟器,则返回null。 i found a link that might help you. 我发现了一个可能对您有帮助的链接。 Like an alternative 像另类

Link 1 链接1

Link 2 连结2

Link 3 连结3

Genymotion emulator doesn't have IMEI code as there was an IMEI code if it's a real phone. Genymotion模拟器没有IMEI代码,因为如果它是真实手机,则存在IMEI代码。 But you can still generate a fake code with some specific method. 但是您仍然可以使用某些特定方法生成伪造的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM