Android 为什么模拟器给 IMEI 号码 000000000000000

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11304278/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:50:05  来源:igfitidea点击:

why emulator giving IMEI number 000000000000000

androidandroid-emulatorimei

提问by Adb

I found many post regarding this but not properly given answer. My application needs IMEI number ,i did that but it is showing 000000000000000(15 zero's). it is working fine with device but i want it run properly on my emulator. i want some unique number except these zero. if any programitically solution here .post your answer's. i have to set this number instead of (15 zeros) "352373051009616"

我发现了很多关于这个的帖子,但没有正确给出答案。我的应用程序需要 IMEI 号码,我这样做了,但它显示 000000000000000(15 个零)。它在设备上工作正常,但我希望它在我的模拟器上正常运行。我想要一些唯一的数字,除了这些零。如果这里有任何编程解决方案,请发布您的答案。我必须设置这个数字而不是(15 个零)“352373051009616”

TelephonyManager telephonyManager =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

String imei = telephonyManager.getDeviceId();

textDeviceID2.setText("Device id:-" +imei);

TelephonyManager telephonyManager =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

String imei = telephonyManager.getDeviceId();

textDeviceID2.setText("设备ID:-" +imei);

any possible solution (programitically as well as hardcoded)

任何可能的解决方案(以编程方式和硬编码方式)

回答by Darshan Rivka Whittle

That's what the emulator uses as the IMEI. If you really need or want to change it, you can open up the emulator executable with a hex editor and modify it as per http://codepainters.wordpress.com/2009/12/11/android-imei-number-and-the-emulator/

这就是模拟器用作 IMEI 的内容。如果您确实需要或想要更改它,您可以使用十六进制编辑器打开模拟器可执行文件并按照http://codepainters.wordpress.com/2009/12/11/android-imei-number-and- 对其进行修改模拟器/

回答by Rendy

Hope thishelps you. You can edit your emulator IMEI number and the instructions are very clear there.

希望对你有帮助。您可以编辑您的模拟器 IMEI 号码,那里的说明非常清楚。

回答by Warcello

From version 27.2.9 android emulator has some IMEI number. (But it seems that it's still not unique)

从版本 27.2.9 android 模拟器有一些 IMEI 号码。(不过好像还不是唯一的)

That probably fixes your problem.

这可能会解决您的问题。