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.
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
You can use
adb shell dumpsys bluetooth_manager
See full answer here: Find connected bluetooth device name using adb?
From Mac OS X, I use this to print only the device name:
adb shell dumpsys bluetooth_manager | \grep 'name:' | cut -c9-
–
Hemicellulose 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'
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 me –
Himyarite
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
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
© 2022 - 2024 — McMap. All rights reserved.
adb devices
command? – Trousers