How can I change the device name? (adb devices)

2019-01-14 01:21发布

I'd like to change the device ID string which can be seen when I type 'adb devices' at command prompt. If I type 'adb devices' at command prompot then I can see below msg,

D:\>adb devices
List of devices attached
5A3C000600000001        device

Is there anyone who knows how the device ID(5A3C000600000001) string generated? And how can I change the device ID string?

标签: android adb
5条回答
冷血范
2楼-- · 2019-01-14 02:03

In android go to Settings > Applications > Development and tap on Device Hostname. You can then change the name and it should show up when attached to adb.

Another solution can be found here: http://forum.xda-developers.com/showthread.php?t=1462320. You will need to get root access and install a terminal client and do some low level hacking to get it fixed.

Another option is to use the Hosts app mentioned in http://www.thriveforums.org/forum/toshiba-thrive-networking/3157-how-do-i-change-device-name.html, though I haven't been able to find the app he is referring to.

Best option I think is just install Cyanogenmod on your devices. It's the most stable custom android rom and has lots of helpful other features that aren't in stock android.

查看更多
等我变得足够好
3楼-- · 2019-01-14 02:03

I have several identical development systems (Odroid A) which report the same device code, thereby preventing me from using more than one on the same host PC with adb. Unfortunately there doesn't seem to be a way of changing this from the gingerbread GUI on this platform as previously suggested.

The device serial number (as reported by 'adb devices') appears to be set in the kernel, under arch/arm/plat-s5p/devs.c (look for 'device_serial'). This may be different for your device, I'd suggest a grep through the kernel sources for the device ID that is reported by adb devices. Change the string, rebuild the kernel and flash it on...

Looks to be different on ICS by the way...

查看更多
smile是对你的礼貌
4楼-- · 2019-01-14 02:17

You can set persist.usb.serialno property. I checked it on Galaxy S4/S4 mini and it's persistent, but you need root access:

adb shell
su
setprop persist.usb.serialno Phone1_GalaxyS4
exit
adb reboot

Than in adb devices you'll have

C:\Users\amdc2452>adb devices
List of devices attached
Phone1_GalaxyS4    device
查看更多
Fickle 薄情
5楼-- · 2019-01-14 02:22

I was also facing the same issue.where two device connected were showing same id in adb devices.

I found this link which solved my issue. Just downloaded the adb from the following link and replaced my original adb.

adb got two same serial numbers when connected to two smart phones

查看更多
beautiful°
6楼-- · 2019-01-14 02:24

If you have root access, you can enter this to a terminal emulator:

> su (to gain superuser access)
> getprop net.hostname (this should display the current network name)
> setprop net.hostname <newhostname>

Disconnect then reconnect from the network to refresh.

I was on a Samsung Galaxy Note on ICS. Worked like a charm...

查看更多
登录 后发表回答