codeofaninja
website

Verify If Android Device is Attached to PC for Debugging

Photo of Mike Dalisay
Modified Friday, August 5, 2011
by - @ninjazhai
There was time when I was trying to run my Android code to my device but it seemed not working. One of the things I thought that causes this was if my Android device is really connected or attached to my computer. So I had to verify if it was. I'm using windows, so here's what I did:

1. Execute the command prompt (cmd.exe)

2. Go to your Android SDK platform-tools directory. I had to execute cd c:\Program Files\Android\android-sdk\plaform-tools in the command prompt

3. Check if ADB is present by executing \adb, if you got those data rolled down, ADB is working fine.

4. See if your device is attached by executing \adb devices, You should see your attached devices which look like something like this:

Verify If Android Device is Attached to PC for Debugging
Click to enlarge.

If no device was attached, you'll receive a message of something like "Waiting for device".

This is also where you can execute the ADB logcat which will make your life easier when debugging your Android App. You can do that by executing \adb logcat


So that's it, you can now run your code from eclipse. :)
For FREE programming tutorials, click the red button below and subscribe! :)
Thanks for the comments!
 
 
Fundamentals
"First do it, then do it right, then do it better."
~ Addy Osmani
"Talk is cheap. Show me the code."
~ Linus Torvalds
Let's Stay Connected!
g+ r
Android app on Google Play
© 2011-2014 The Code Of A Ninja. All rights reserved. Proudly Powered by Google Blogger. Images, logos, marks or names mentioned herein are the property of their respective owners.