Solved

Android ADB USB port ID

Posted on 2014-04-09
2
924 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

Suggested Solutions

Title # Comments Views Activity
moto 4g plus phone applications 2 23
SQL Server error 26 103
Windows 7 Share with concurrent edits(Excel) 3 33
Run time Error 4 34
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now