Unable to connect you device to Ubuntu OS for development? I faced the same problem today when reverted back to 10.04 LTS from 12.04 as I wasn’t happy with the new Natty UI of my prior installation. After searching through internet and testing a few of the proposed solutions I found one working for me, which I am posting here.

The three general steps I followed before starting with the development were as follows:

  1. Added android:debuggable="true" to the <application> element in my project AndroidManifest.xml file
  2. Enabled installation of unknown sources Settings >> Security >> Unknown Sources
  3. Enabled USB Debugging from Settings >> Developer options >> Android Debugging

Still ADB (Android Debug Bridge) wasn’t detecting my device and on executing command  adb devices I was getting:

I tried adb kill-server and adb start-server twice even with root privileges, still got no luck.



1. Modify Your Path Environment Variable

This isn’t a part of the solution, but will make your life much easier if you’ll be using ADB Commands directly into terminal afterwards. To modify your environment variable you’ll have to modify your .bashrc file in home directory, to edit via terminal execute the following commands:

Your terminal will open the file in nano editor, at the end of the file add the following:

Editing bashrc profile settings profile
Notice: we are assuming that your android sdk has been placed directly inside your home folder with the same folder name it comes with.

To save file press CTRL + X and Y to confirm the modifications.To reload your Bashrc profile so that changes can take effect, you can either logout and login to your account or execute this command in your terminal: source ~/.bashrc. Now you can access ADB on your terminal from anywhere you want, give it a try đŸ˜‰


2. Hardware Setup

Now that we have our Environment Path variable set we’ll have to make sure that our hardware will be detected once we’ll initialize the ADB Daemon. To make Ubuntu allow ADB access to our Android Device we’ll set appropriate udev rules. This includes file creation as the root user. In terminal, execute:

and inside the file, copy the exact same lines:

Adding android udev rules in ubuntu

Save changes and quit nano editor.

Now we have our ADB udev rule set, we’ll need to restart our ADB Server to make the changes take effect via:

your device have been detected by now and  a message like this will be at your screen:

Setting up android development in ubuntu

ADB has detected my device successfully