30

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?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
user1280781
  • 309
  • 1
  • 3
  • 3

6 Answers6

21

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...

rationalboss
  • 5,330
  • 3
  • 30
  • 50
Chris
  • 275
  • 2
  • 2
  • 8
    The `net.hostname` property is not queried by `adb`, so I don't see how this could have any effect on `adb devices`. This, and a link in an earlier comment, relate to the way the device appears in a DHCP host list (e.g. "android-123456789"), and is not related to the question. – fadden Dec 14 '12 at 02:03
  • 6
    This is answering the wrong question, but it helped me tremendously! – palswim Aug 08 '13 at 06:10
  • 1
    Same here. I was looking for a way to change the DHCP hostname indeed. – Michele Dall'Agata Feb 24 '16 at 00:26
  • Obviously this won't work, need to change usb name. – DAme Nov 14 '19 at 15:59
6

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
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
4

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...

Mark Edgeworth
  • 151
  • 1
  • 4
  • 2
    The previous answers did not solve the problem in my situation, although the question was directly applicable. I had hoped that the information that I found would be of use to someone as it directly answers the original question. I don't think I posed a new question... – Mark Edgeworth Aug 22 '12 at 09:58
  • You're right. I think I read over this too fast... my fault. Sorry. – SDwarfs Aug 22 '12 at 13:34
4

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.

Michael Allen
  • 5,712
  • 3
  • 38
  • 63
2

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

Community
  • 1
  • 1
Indraneel
  • 306
  • 1
  • 3
  • 8
0

In addition to other answers guiding to rename the device serial, you can also use its transport_id to access.

Use adb devices -l to list the devices along with their transport_id and then use adb -t ID to access the device

adb devices -l

# first_huge_device_id0000 device product:p124 model:md1 device:d1 transport_id:1
# second_huge_device_id0000 device product:pr123 model:md2 device:d2 transport_id:2

adb -t 1 ...
# uses first device
Mahdi-Malv
  • 16,677
  • 10
  • 70
  • 117