Android Bytes

…everything is a bytearray after all

Installation guide to ADB on Ubuntu

Here’s a nice guide to install ADB on Ubuntu, since there aren’t many guides for doing that. First of all, I must admit that the guide is written by bloodychaos.
The guide is written for Ubuntu 10.10, but I really don’t see why you can’t apply this guide to any version of Ubuntu.

1. Install JDK

You’ll need to install JDK for ADB to work. If you have already installed JDK, I recommend reinstalling it again, just in case there are new updates or you have the older version.
In Terminal, do the following

sudo add-apt-repository ppa:sun-java-community-team/sun-java6

sudo apt-get update

sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk

If you want or need to use Eclipse, here’s a simple installation command

sudo apt-get install eclipse ruby rubygems ruby-dev libxml2 libxml2-dev libxslt-dev openjdk-6-jdk ant git

sudo gem install nokogiri

2. Download and Install Android SDK

Download the Android SDK. Obviously, choose the one for Linux

Extract the android-sdk-linux_x86 folder from android-sdk_r10-linux_x86.tgz. Just double click the tgz file, and drag-n-drop the that lone folder to your desired location. In my case, I extracted the files to my Home Folder, which I highly recommend. I’ll also advice to not renaming the folder.

3. Choose packages to install

In Terminal, type the following -

cd ~/android-sdk-linux_x86/tools

./android update sdk

The ‘Android SDK and AVD Manager’ window will appear. You can choose to accept all of them or just install all except for Android 1.5 and 1.6. Once installation is finished, it will prompt you to restart the manager. Just click ‘Yes’ and close the manager


4. Check your device’s permission

Now head over to the platform-tools directory

cd ~/android-sdk-linux_x86/platform-tools

Check if you have permission for your device

./adb device


If you’re getting the following, your good

List of devices attached
????????????	no permissions

If you’re getting something like this or other random numbers with the word device next to it, congrats! You now could use ADB. Now go on to Step 7.

List of devices attached
0123456789ABCDEF	device

5. Giving permission to your device

You’ll need to create a certain udev rule. First off type the following in Terminal:

sudo gedit /etc/udev/rules.d/99-android.rules

Once the gedit window pops-up, type the following line

SUBSYSTEM=="usb", ATTRS{idVendor}=="####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"

Take note of ATTRS{idVendor}=="####". Replace #### to the correct Vendor ID of your device. If you’re using Acer, then it’s 0502, for HTC it’s 0bb4. ADB might not be able to detect your device if you use the wrong ID. Here’s a list of each vendor’s ID. Source:…ng/device.html

Manufacturer	USB Vendor ID
Acer		-0502
Dell 		-413c
Foxconn 	-0489
Garmin-Asus 	-091E
HTC 		-0bb4
Huawei 		-12d1
Kyocera 	-0482
LG 		-1004
Motorola 	-22b8
Nvidia 		-0955
Pantech 	-10A9
Samsung 	-04e8
Sharp 		-04dd
Sony Ericsson 	-0fce
ZTE 		-19D2

Save the file and exit out of gedit. Back in Terminal execute the following

sudo chmod a+rx /etc/udev/rules.d/99-android.rules

sudo restart udev

Now to check if it works

./adb devices

You should be getting the following line or something similar.

List of devices attached
0123456789ABCDEF	device

Congrats! Now you can use ADB in Ubuntu! Now hop on to Step 6!

If that fails and still give you "???????????? no permissions", try restarting the adb server. That should do the trick. If that still doesn’t work, check the file, 99-android.rules, that you created earlier. Most likely you have put in the wrong Vendor ID.

sudo adb kill-server

sudo nohup adb start-server

6. Now to have fun!

Head down to Captainkrtek’s ADB Workshop and Guide for everyone to learn how to use ADB. Take note that while using adb in Linux, you’ll need to type ./adb to execute adb unless you create a path in bashrc. Go to Step 7 for that . For now, here are some examples on running adb if you don’t create a path.

First, go to the platform tools directory:

cd ~/android-sdk-linux_x86/platform-tools

To get into the phone

./adb shell

To grab files from phone

./adb pull /system/etc/file.txt file.txt

To send file to phone

./adb push this.txt /sdcard/this.txt

Also, do take note that when you pull a file, it will save itself in your android-sdk-linux_86 folder if no destination folder was given.

7. Create path for ADB

sudo gedit ~/.bashrc

Add the following line at the very end of the file. Once you’re done, save and exit.

# Android tools
export PATH=${PATH}: ~/android-sdk-linux_x86/tools
export PATH=${PATH}: ~/android-sdk-linux_x86/platform-tools

Now you can just run adb like it’s a command.

Edit: Okay, for some odd reason, while the above worked for my desktop, it failed when I tried it on my notebook. If you tried to create a path but it failed, here’s an alternative method

gedit ~/.profile

Once the gedit window pops up, scroll down to the very bottom of the file and add this line


Once you’ve saved and closed gedit, run the following command in Terminal

export PATH="$HOME/android-sdk-linux_x86/tools:$HOME/android-sdk-linux_x86/platform-tools:$PATH"

And that’s about it. Feel free to comment, give suggestions or ask questions if you’re still unsure.

If you found this interesting, please don't forget to like/share it. Like the page too, in order to receive all the updates in Facebook.

No related posts.

  • windows 8 best themes

    Update: Samsung introduces Galaxy Tab 8.9

  • кран балка подвесная

    Сенкс. Интересно, и вообще полезный у Вас блог

  • Andrew

    english? pretty please? :D

Subscribe to email feed

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Difference Between A

The post title is referring to the difference between Android ...

HTC Sense 3.5 is com

coolexe, a very appreciated developer from xda-developers has managed to ...

Asphalt 6: Adrenalin

If you own a Samsung Galaxy S II or a ...

Ice Cream Sandwich S

At Google I/O this year, the newest version of Android ...

Android Hacker's Key

Here’s a full 5-row keyboard including arrow and Esc/Ctrl keys, ...

Difference Between A

The post title is referring to the difference between Android ...

HTC Sense 3.5 is com

coolexe, a very appreciated developer from xda-developers has managed to ...

Free some space on p

Data2Ext is an excellent hack to have your “internal memory” ...

Install InsertCoin R

InsertCoin ROM is one of the best custom ROMs for ...

Flashing a custom HB

Installing a custom ROM may become a little bit frustrating ...