Is there a way to get the device name using adb? For example, if the device name is John Doe's Nexus, how to get the name using a command?
Asked Answered
S

4

7

I have an android device, which when registered to an account renames itself after the account name. I need to get that name using adb.

Shipboard answered 21/2, 2019 at 15:16 Comment(2)
Can you retrieve what you want with the adb devices command?Trousers
adb devices retrieves the serial number but I want to get the user friendly name. Thanks.Shipboard
S
6

You can use

adb shell dumpsys bluetooth_manager

See full answer here: Find connected bluetooth device name using adb?

Stacte answered 1/6, 2019 at 12:5 Comment(1)
From Mac OS X, I use this to print only the device name: adb shell dumpsys bluetooth_manager | \grep 'name:' | cut -c9-Hemicellulose
L
1

Try this:

./adb shell getprop

It returns all device properties which should also contain the name that you are looking for. I got multiple name properties:

[ro.product.name]: [TA-1032_00WW]
[ro.product.nickname]: [Nokia 3]
[ro.vendor.product.name]: [NE1_00WW_FIH]

I think you are looking for ro.product.nickname. You can get it with this command on Mac/Linux:

./adb shell getprop | grep "ro.product.nickname"

The Windows command should be similar. Something like this:

adb shell 
getprop | grep -e 'ro.product.nickname'
Leopardi answered 21/2, 2019 at 17:42 Comment(2)
Hey, thanks but I am not looking for the nickname but the user friendly name that can be set by the user himself.Shipboard
'ro.boot.qemu.avd_name' was the key that ended up working for meHimyarite
D
1

It's not totally clear, but you may be looking for the user-editable 'device name' (in the settings, under 'About Phone'). To get that, run:

adb shell settings get global device_name
Discountenance answered 4/6 at 7:43 Comment(0)
O
0

I think you can use the adb devices -l argument there to get the info and the you can just filter the output to obtain the model ej:

❯ adb devices -l
List of devices attached
16fb60660205           device usb:1245184X product:daisy model:Mi_A2_Lite device:daisy_sprout transport_id:7
9A101FFBA003K4         device usb:1179648X product:coral model:Pixel_4_XL device:coral transport_id:8
Oleate answered 2/2 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.