?
Solved

Android ADB USB port ID

Posted on 2014-04-09
2
Medium Priority
?
1,090 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
hjgode earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Often, people trade privacy and security for convenience. However in today's concrete jungle, this is an extremely foolish decision considering the vast amount of technologies being used against consumer interest. First off, I won't waste any time e…
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses
Course of the Month10 days, 22 hours left to enroll

770 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