Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Android ADB USB port ID

Posted on 2014-04-09
2
Medium Priority
?
1,158 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Suggested Courses

609 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