Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何获得使用adb设备打印的设备名称?_Android_Shell_Device_Adb - Fatal编程技术网

Android 如何获得使用adb设备打印的设备名称?

Android 如何获得使用adb设备打印的设备名称?,android,shell,device,adb,Android,Shell,Device,Adb,我打字的时候 adb devices 在控制台中,然后打印以下内容: List of devices attached SH16BV815282 device 如果可能的话,我如何通过编程方式获取SH16BV815282 我希望在运行时通过android应用程序获得该值。该值实际存储在何处?它是。但是,它只在Android 2.3+上可用。我使用blow代码获取设备名称 GUIStatics.deviceModel=android.os.Build.MODEL 因此,在2.3下,我不

我打字的时候

adb devices
在控制台中,然后打印以下内容:

List of devices attached 
SH16BV815282    device
如果可能的话,我如何通过编程方式获取
SH16BV815282


我希望在运行时通过android应用程序获得该值。该值实际存储在何处?

它是。但是,它只在Android 2.3+上可用。

我使用blow代码获取设备名称


GUIStatics.deviceModel=android.os.Build.MODEL

因此,在2.3下,我不能读取这个?是否有一些ACL(如片段)可以委托读取这个值?不,至少不是以一种非常粗糙的方式。关于黑客方式,请参考Yashwanth Kumar的答案中的第二个链接。adb设备和Build.SERIAL在我的galaxy选项卡10.1上给出了非常不同的结果,android 3.2Build.SERIAL在galaxy s上给出了“未知”(操作系统版本2.3.3)。