Can I use adb.exe to find a description of a phone

2019-02-01 01:29发布

If I call the command "adb.exe devices" I get a list of devices with a unique ID for each. These IDs are perfect for programming but not very human readable. Is there any way I can link one of these IDs to a (not necessarily unique) description of the phone? For example, if I have a device with an ID 1234567890abcdef is there any way I can figure that in real life it is a Motorola Droid X?

标签: android adb
5条回答
We Are One
2楼-- · 2019-02-01 01:46

Yes, adb shell cat /system/build.prop is wonderful, but also as @Matt said, it sometimes differs because of different manufacture.

IMHO, the most reliable approach is the built-in command: adb shell getprop

======================================================================

Here is a comparison for an exception (Genymotion emulator):

By adb shell cat /system/build.prop you'll get

ro.product.brand=generic
ro.product.name=vbox86p
ro.product.device=vbox86p
ro.product.board=
ro.product.cpu.abi=x86
ro.product.manufacturer=Genymotion
ro.product.locale.language=en
ro.product.locale.region=US

So there is no model value :(

By adb shell getprop you'll get

[ro.product.manufacturer]: [Genymotion]
[ro.product.model]: [Nexus422ForAutomation]
[ro.product.name]: [vbox86p]

Here you get the model name: Nexus422ForAutomation :)

查看更多
狗以群分
3楼-- · 2019-02-01 02:04

With newer devices, you can run

adb devices -l

This will list some devices in a more human readable form

Example:

04d9a601ce516d53 device usb:1A134500 product:occam model:Nexus_4 device:mako
015d4b3406280a07 device usb:1A134700 product:nakasi model:Nexus_7 device:grouper
01466E620900F005 device usb:1A134600 product:mysid model:Galaxy_Nexus device:toro
查看更多
Viruses.
4楼-- · 2019-02-01 02:09

I'm using this script (on MacOS):

 #!/bin/bash

devices=`adb devices | grep "device" | grep -v "List of" | cut -d " " -f 1`

for device in $devices
do
    manufacturer=`adb -s $device shell getprop ro.product.manufacturer | sed -e 's/[[:space:]]*\$//'`
    model=`adb -s $device shell getprop ro.product.model | sed -e 's/[[:space:]]*\$//'`
    echo "$device: $manufacturer $model"
done

It produces e.g. the following output:

T076000UWX: motorola XT1053 
C4F12070E5A068E: samsung GT-P7510
4df1ff977b919f91: samsung GT-N7100 
4258393032523638324D: Sony Ericsson LT18i
查看更多
兄弟一词,经得起流年.
5楼-- · 2019-02-01 02:10

In Android there is a Model number entry in settings that shows phone name.

There is a way to quickly see this via command line:

adb shell cat /system/build.prop | grep "product"

This is what's shown for Samsung Galaxy S 4G:

ro.product.model=SGH-T959V
ro.product.brand=TMOUS
ro.product.name=SGH-T959V
ro.product.device=SGH-T959V
ro.product.board=SGH-T959V
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=Samsung
ro.product.locale.language=en
ro.product.locale.region=US
# ro.build.product is obsolete; use ro.product.device
ro.build.product=SGH-T959V

On a HTC Desire, the output looks like this:

ro.product.model=HTC Desire
ro.product.brand=htc_wwe
ro.product.name=htc_bravo
ro.product.device=bravo
ro.product.board=bravo
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=HTC
ro.product.locale.language=hdpi
ro.product.locale.region=

You can refine your query to show only one line:

adb shell cat /system/build.prop | grep "ro.product.device"

or

adb shell cat /system/build.prop | grep "ro.product.model"
查看更多
你好瞎i
6楼-- · 2019-02-01 02:11

Unfortunately, there is no reliable way to do this since each manufacturer tweaks their build properties

If you type "adb help" into the command line you can see a list of the adb commands and a description for each.

查看更多
登录 后发表回答