[Tutorial] ADB on (X)ubuntu

I got interested how to compile Android ROMs and Kernels. But this is not possible under Windows, so I started a fight to get Xubuntu running on my laptop. Finally I won the war and had a running Xubuntu on my device, SDK, Java, Eclipse, … installed. But adb didn’t like to work, “adb not found”, “no device connected” are only 2 of the problems I struggled with. So I started an intensive Google search attack and found solutions scattered on several forums and blogs.

Here is a Linux-Dummy trial to get all the information together in one tutorial.

Warning! You are changing system files on your Xubuntu installation. Please check any change double! I do not take any responsibility if you mess up your Linux machine.

First I asume that you have a running Xubuntu and installed Android SDK to your home folder. I installed the SDK under /home/beegee/sdk to keep the path name short, but you can choose whatever location you like. I will refer to my sdk as <SDKPATH>, you need exchange this with your own path.

Root access

For some changes you need root access on Xubuntu. Usually the user “root” is not available on Ubuntu, but there is a way around. Open a terminal window and type

  • sudo passwd

You will first be prompted to enter your user password (which you set during installation or whatever), and you can then enter a new root password. [source]

For the next steps it is best to log into the root account, as we need to make some changes that we can do only with root access. To logout from your user account, click on your username in the top right corner and click logout.

You will be prompted with a new login screen, but the user “root” will not be shown. Select “Other account” and type as username “root” and then the password you set in the last step. Once you logged in as “root” we can do the necessary steps to get adb working.

Set path to adb

To get adb working from any terminal window you have to add its path to the systems path variable. You can do this everytime you boot your Xubuntu, but there is a way to add it permanent. You have to edit the file .bashrc with a text editor. I prefer MousePad, but of  course you can do it with any other editor as well. Open a terminal window and type

  • mousepad ~/.bashrc

Enter the the following 2 lines at the end of the file and save it.

  • PATH=$PATH:<SDKPATH>/platform-tools/
  • export PATH

Don’t forget to replace <SDKPATH> with the path to folder you installed SDK to. Now you can use adb from anywhere. [source]

Set USB configuration for your tablet

adb needs a USb configuration file for each device that it should work with. This configuation file is located in /etc/udev/rules.d and named 51-android.rules. To enter the correct data into the file we need the vendor id. For Advent Vega, Viewpad 10s and similar tablets with the NVidia Tegra processor the vendor id is “0955″. But you can double check this. Connect your tablet to your Xubuntu machine, make sure your tablet has USB debug enabled in <Settings> <Applications> <Development> <USB debugging>. Open a terminal window and type

  • lsusb

This gives you a list of attached USB devices and their vendor ids. Look for the one with NVidia Corp. We need the first 4 digits.

Open with your favorite text editor the file /etc/udev/rules.d/51-android.rules or create it if it does not exist. Then enter

  • SUBSYSTEM==”usb”,SYSFS{idVendor}==”0955″,MODE=”0666″

and save the file. To enable access to this file from other user accounts, open a terminal window and type

  • chmod a+r /etc/udev/rules.d/51-android.rules

Now we are done with the preparations to use adb. [source]

Test

Log out from the root account and log in to your “normal” user account. To test if all settings are correct, disconnect and reconnect your tablet to your Xubuntu machine. Then open a terminal window and type

adb devices

You should see your device now.

I hope this tutorial helped you to get ADB running on your Linux installation. As said on the top, all these steps are collected from different sources on the web. I just tried to bring them together.

Warning! You are changing system files on your Xubuntu installation. Please check any change double! I do not take any responsibility if you mess up your Linux machine.

This entry was posted in Tips&Tricks and tagged , , , , , , . Bookmark the permalink.

6 Responses to [Tutorial] ADB on (X)ubuntu

  1. Pingback: [Tutorial] ADB on (X)ubuntu

  2. Pingback: [Tutorial] ADB on (X)ubuntu | Xoom Root

  3. Pingback: Dual Booting Android 3.2 and Ubuntu 11.04 on an Asus Transformer « Stream #0

  4. Ricardo says:

    Hi there; nice tutorial. But didnt work for me.
    Every time i try to use adb, it says file not found/directory not found, and eclipse also gives the same error.
    The files7directories are there!!! OMG im going insane…
    Thanks in advance

  5. Joe says:

    Hi,

    I had to enter “./eclipse” for Eclipse to run, and “./adb” for adb to run in terminal…

    I am still working on getting my Xubuntu machine to recognize my partially bricked KF2.

    Joe

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>