Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...