Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Linux won't talk to my phone by USB. Ideas?

I'm following along with "Building a Simple Android App" at https://teamtreehouse.com/library/build-a-simple-android-app/testing-and-debugging/running-the-app-on-a-device

and although I want to install the app to my phone, there's no evidence that my computer is aware of my phone, other than the fact that it's charging the phone.

Checklist of things done:

  • On phone, enabled developer options by clicking version number 7 times.
  • On phone, enable USB debugging
  • The "ADB Logs" tab in Android Studio is empty

Reading from "Using Hardware Devices" at http://developer.android.com/tools/device.html, subsection "Setting up a Device for Development"

  • Added android:debuggable="true" to the project's AndroidManifest.xml file and rebuilt
  • Set /etc/udev/rules.d/51-android.rules to contain just the line SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" (I think this is the proper text for a Google Nexus 5, the above link was a little ambiguous IMO).
  • /etc/udev/rules.d/51-android.rules is root.root -rw-r--r--
  • Did not actually reboot
  • Did plug in & out the phone several times.

When I run "adb devices", the utility returns an empty list. When I use the IDE's Android DDMS tab thing, in the "Devices | logcat" tab it declares No Connected Devices. There's a GUI app called "Android Device Manager" that can be launched from the IDE. It also has an empty list of devices.

I looked around in /var/log/ for anything interesting - found nothing. No USB announcements of any sort when the thing is plugged in our taken out. That seems wrong.

If the Minds here have no suggestions, I guess I'm going to try to get MTP file transfer going between the phone and the computer. Maybe that'll shake up the USB system enough for something to start working....? :(

Hold on, maybe this cable is "charging only". Maybe it doesn't support data. Lemme check the cable.

1 Answer

Yeah, the problem was the Good Dynamite Cable. Well, that was an hour wasted. Maybe I should delete this thread.