Solved

Android ADB USB port ID

Posted on 2014-04-09
2
940 Views
Last Modified: 2014-04-10
Hello and thanks for having a look at this.

I'm using Windows 7 with Android ADB.

I'm writing a test application that has several Android devices on a system at one time, all with there own USB connection.

I would like to send different ADB commands to devices depending on where they are in the system. (different USB lines are connected to different test fixtures)

I know about "ADB devices" which will give me a list of devices on the system, but it won't tell me where or on which fixture the device is located.

Can anybody think of a way I can find out automatically, which USB line goes to which device?
(I say automatically because there can be no user interaction with the system until testing is complete)

Huge thanks if you can help with this.

Nick
0
Comment
Question by:Nickleback
2 Comments
 
LVL 16

Accepted Solution

by:
hjgode earned 500 total points
ID: 39992249
You should log the attached devices to see which device is known before you connect.

adb devices lists the devices connected and adb -s serialname command will be excuted on the device with serialname: http://developer.android.com/tools/help/adb.html#directingcommands

So if you have three fixtures, place first device and list devices. You get a serialname1. Put another device in next fixture and list devices, the new one is on second fixture. Do the same with the following devices and fixture then you can call the utils with "adb -s serialnameX command".

Is this OK? The USB connection is not essential here but the device's serialname.

OTOH the linux lsusb tool is available for windows too (http://www.tucows.de/preview/1154905/Lsusb), sometimes called USBview (a GUI variant). Using lsusb you can watch for android USB connections.
0
 

Author Comment

by:Nickleback
ID: 39992773
Ahhh good one thanks very much. I can see how this might work now.
I was hoping there might be a direct route like a "Get Attached port no" command in ADB or something like that but I don't think one exists and the approach will need to be something like that.

Once again thanks

Nick
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OfficeMate Freezes on login or does not load after login credentials are input.
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question