Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

I have two smart phones (ZTEV788d, system Android 2.3.6) connected to a computer (Ubuntu 11.10) at the same time, using command: adb devices I got this:

List of devices attached
P753A12D    device
P753A12D    device

The serial numbers are the same!

I wrote an application in the computer side to communicate with these two phones, for example install app and push files.

I used these commands:

adb -s P753A12D install XXX.apk
adb -s P753A12D push XXX /sdcard

Now these two phones have the same serial no (P753A12D), when I run these commands I get this error:

error:more than one device

So, my questions are:

  1. Is that normal that two phones to have the same serial no?
  2. Can I change the serial no? if yes, how?
  3. Is there any way to run these install, push commands successfully even if the serial no are the same?

BTW, the WiFi/3G network will be turned off when I'll run the test.

like image 317
Alen Avatar asked Dec 21 '12 07:12

Alen


People also ask

Can two phones have the same serial number?

They are unique. It is not possible for more than one phone to have the same serial number.

How can I tell what devices are connected to adb?

Using the ADB Devices CommandOn your computer, press Win+R to open the Run dialog. In the Run dialog, type cmd and press Enter . This will open Windows command prompt. Check whether your device is on the list.

Which adb option should you use if you have multiple devices connected?

If multiple emulators are running and/or multiple devices are attached, you need to use the -d, -e, or -s option to specify the target device to which the command should be directed. The table below lists all of the supported adb commands and explains their meaning and usage.

Is serial number unique Android?

Your device's serial number is a unique code that the manufacturer gives the phone. No two serial numbers are the same. Should you need to find your phone's, there are a few places you can look. A serial number is usually a combination of letter and numbers.


2 Answers

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
like image 62
Aleksei Potapkin Avatar answered Oct 19 '22 23:10

Aleksei Potapkin


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.

like image 33
Rahmat Waisi Avatar answered Oct 20 '22 00:10

Rahmat Waisi