Solved

Android ADB USB port ID

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

13 Experts available now in Live!

Get 1:1 Help Now