Adb got the same serial number when two phones are connected to a computer. Can I change the serial number?

I have two devices connected to my computer at the same time. If I use the command: adb devices, adb got this:

List of connected devices Device 0123456789ABCDEF 0123456789ABCDEF device

So the devices have the same serial number! I want to control both devices via USB to debug my application, but I have this error:

[2013-01-21 20:28:12 - DeviceMonitor] Failed to start monitoring 0123456789ABCDEF: more than one device

I think I have this error because the devices have the same serial number. I've read other discussions and I'm trying these instructions on the terminal:

$ su

getprop net.hostname

Android-b112064be9bfd82

So..0123456789ZBCDEF is not a serial number.

Does someone know how I can change the serial number? Sorry for my bad english.

+3


source to share


1 answer


To temporarily (until reboot) change the ADB serial number, disconnect all but one of the devices and enter this in the command window:

adb shell 'echo -n "XXXXXXXXXXXXXXXX" > /sys/class/android_usb/android0/iSerial'

      



where X represents the desired serial number. This change requires root and will only work until the device is rebooted. To make it permanent, you will need to change one of the system startup scripts in order to make the change.

Note that this does not work as often on newer devices; the location of the file appears to have changed.

+1


source







All Articles