adb got two same serial numbers when connected to two smart phones
Today I found an easy solution for this issue.
adb devices -l
You'll get list of devices with their qualifiers
List of devices attached
P753A12D device usb:26200000 transport_id:1
P753A12D device usb:24400000 transport_id:2
Then you can use qualifiers instead of serial numbers like this
adb -s usb:26200000 install xxx.apk
or with transport_id
and -t
adb -t 1 install xxx.apk
if your device is rooted
try this way
to change serial number your devices , first connect one of them to your pc then type this in cmd
adb devices
this shows your device id (serial number).
List of devices attached
P753A12D device
pick some new name ,for example NAME1
then type this commands
adb shell
su
device_name="NEW_NAME"
cd /sys/class/android_usb/android0/
echo -n $device_name > iSerial
cat iSerial
exit
exit from root exit
exit from shell
START
now unplug the usb cable and run this commands
adb kill-server
connect your device again and type
adb devices
now you can see changes
List of devices attached
New_NAME device
END
note : if it did not work first time
disconnect your phone and do this parts of my guide from START to END again.
I faced the very same problem. It's because the adb tool uses the serial numbers for identification of devices connected to usb instead of their device paths (which are unique for sure).
If you feel up to getting your hands dirty, download the Android source tree, go to system/core/adb/transport.c
, change it to something like that:
void register_usb_transport(usb_handle *usb, const char *serial, const char *devpath, unsigned writeable)
{
atransport *t = calloc(1, sizeof(atransport));
D("transport: %p init'ing for usb_handle %p (sn='%s')\n", t, usb,
serial ? serial : "");
init_usb_transport(t, usb, (writeable ? CS_OFFLINE : CS_NOPERM));
// if(serial) {
// t->serial = strdup(serial);
// }
if(devpath) {
t->devpath = strdup(devpath);
t->serial = strdup(devpath);
}
type make adb
from the top level path and voila. Devices use usb paths for identification. Now you can install & execute all of the devices from Eclipse with one click.