Forums Added for the Oppo R5, Oppo N3, and Xiaomi Redmi Note

Just yesterday, Oppo unveiled a pair of rather unique smartphones, the Oppo … more

How to Play Music From Android Wear – XDA TV

Yesterday, we showed you how to do some advanced things with your Moto 360 quite easily … more

Google Updates Play Games, Wallet, Docs, Sheets, Slides, Drive, Google+, and Camera

While we haven’t really had much in the way of … more

Google Execs Talk to Ars About Android 5.0 Lollipop

Android 5.0 Lollipop is right around the corner, and it’s expected to hit AOSP … more
Post Reply

[HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux

OP wddglr

17th July 2009, 12:27 AM   |  #1  
wddglr's Avatar
OP Member
El Paso, TX
Thanks Meter: 17
 
77 posts
Join Date:Joined: Jan 2009
More
When I first attempted to install the SDK, I found tutorials that only had bits and pieces about the whole procedure. A lot of Google searches and hours of eye strain. I wanted to write a solid tutorial, but instead of publishing it in a personal blog, I chose to publish it here on xda-developers. This is the definite forum to come to if you are interested in Android/G1/HTC Dream development or costumization. I wrote this to make the enlarge the knowledge of this community.


!! THIS TUTORIAL IS FOR THE LATEST UBUNTU RELEASE: JAUNTY JACKALOPE 9.04 !!

!!START -------------------------------------- Optional Preparation --------------------------------------

This applies if you -
  • Are interested in installing Ubuntu for the first time.
  • Are/will be reinstalling Ubuntu from scratch.
  • Want to keep your SDK installation easy to reach.
  • Want to keep things nice and clean.
And your machine -
  • Has a second hard drive.
  • Has free space for another small partition.
This procedure will make things easier during installation of the SDK and in the long run. Hopefully you've read about partitions. If you are dualbooting, please read this first to get an idea of what you're doing.
  1. While installing Ubuntu and on the Prepare Disk Space screen (partition editor), select "Specify partitions manually (Advanced)"
  2. On the Create Partition dialog, select the following options:
    • Type for the new partition: Primary
      or Logical if you're dualbooting and know what you are doing.
    • New partition size in megabytes: 5120MB (5GB) might work. BUT:
      Quote:
      Originally Posted by ccyrowski

      It should be noted that if you ever plan on compiling kernels and/or cupcake ROM's you will NEED ubuntu8.04. You'll also need at least 10GB.

    • Location for the new partition: Beginning
    • Use as: Ext4 or Ext3
      Filesystem doesn't matter. (?)
    • Mount point: /AndroidSDK
      Enter this manually
  3. Complete Ubuntu installation as usual.

-------------------------------------- Optional Preparation -------------------------------------- END!!


You will now install the SDK.




!!START -------------------------------------- Installing Android SDK --------------------------------------


Installing the SDK is the easiest of all.

  1. Download the SDK.
    169.9 MB [http://developer.android.com/sdk/dow...x86-1.5_r3.zip]
  2. Right-click and select Extract Here.
  3. Move the contents of the android-sdk-linux_x86-1.5_r3 directory to your desired location.
    If you followed Optional Installation, move the contents to your /AndroidSDK directory in the root of your filesystem.
  4. Close directory window.
-------------------------------------- Installing Android SDK -------------------------------------- END!!



You will now set up your bashrc file and UDEV to recognize your HTC Device.



!!START -------------------------------------- ADB + FASTBOOT --------------------------------------

The Android Debug Bridge (adb) is one of the tools that will help you the most when you run into flashing problems or running shell commands directly from your machine. UDEV will not recognize your G1 out of the box, but we will configure it with some rules so it can connect.

We will work with /AndroidSDK as the location of your sdk. If this is not your setup, I think you're smart enough to figure it out.


Editing .bashrc file to use tools from /AndroidSDK/tools/ directory -
  1. Go to your home folder.
    Example: /home/wddglr/
  2. Press Control + H to view hidden files.
  3. Look for your .bashrc file and double click to open it with gedit.
  4. Add the following lines to the top of the file:
    Code:
    #AndroidDev PATH
    export PATH=${PATH}:/AndroidSDK/tools
    IMPORTANT NOTE
    Quote:
    Originally Posted by savethechicken

    This is the way that I have my .bashrc file setup. For those having problems with it not recognizing the adb as a command try this...

    Code:
    export PATH=$PATH:/AndroidSDK/tools
    I removed the {} around ${PATH} and it is working if I had them on it would say that it didn't recognize the command. Removed them and all works well.


Setting up UDEV to recognize HTC Device -
  1. Type the following into a terminal (Applications > Accessories > Terminal):
    Code:
    gksudo gedit /etc/udev/rules.d/51-android.rules
  2. Now add the following line to the blank file:
    Code:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
  3. Click save and close.
  4. To restart udev, open up a terminal and enter:
    Code:
    sudo /etc/init.d/udev restart

Setting up fastboot -
  1. Download this fastboot binary from http://android-dls.com.
    130.4 KB [http://android-dls.com/files/linux/fastboot]
  2. Once downloaded to your desktop, right click and select Properties.
  3. Navigate to the Permissions tab and configure the following option:
    Execute: [√] Allow executing file as program
  4. Click Close.
  5. Move the fastboot bianary to your /AndroidSDK/tools/ directory.
  6. Reboot.
-------------------------------------- ADB + FASTBOOT -------------------------------------- END!!
Now you can use adb and fastboot directly from any terminal. If you chose to do the Optional Preparation, you can now save your Eclipse Workspace and your downloaded/custom ROMs/Themes in this new /AndroidSDK directory keeping things easier to reach and safe from evil disk errors or other mishaps!!! :eek:
If you are having problems, send me a PM. I will be happy to help.
Last edited by wddglr; 22nd September 2009 at 01:12 AM.
The Following 12 Users Say Thank You to wddglr For This Useful Post: [ View ]
17th July 2009, 12:46 AM   |  #2  
Senior Member
Thanks Meter: 12
 
1,364 posts
Join Date:Joined: Mar 2009
*applaudes* awesome. Should be added to helpful threads.
17th July 2009, 12:47 AM   |  #3  
Member
PDX
Thanks Meter: 0
 
70 posts
Join Date:Joined: Jul 2008
More
Thumbs up
very nice! perhaps add a "(How-To)" prefix to thread??
17th July 2009, 02:31 AM   |  #4  
Member
Thanks Meter: 0
 
93 posts
Join Date:Joined: May 2009
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"

I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
17th July 2009, 02:40 AM   |  #5  
wddglr's Avatar
OP Member
El Paso, TX
Thanks Meter: 17
 
77 posts
Join Date:Joined: Jan 2009
More
Quote:
Originally Posted by nicholasbithell

Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"

I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?

it does not exist, you will make it.
do the command as stated above.
Code:
gksu gedit /etc/udev/rules.d/51-android.rules
17th July 2009, 03:07 AM   |  #6  
cynofox's Avatar
Junior Member
Houston
Thanks Meter: 0
 
6 posts
Join Date:Joined: Jun 2008
More
Damn you beat me to it!
I was just thinking earlier about doing this same "How-To" guide, I was surprise to see it posted just now.

Anyways, great job!
17th July 2009, 03:55 AM   |  #7  
Z҉A҉L҉G҉O̚̕̚'s Avatar
Senior Member
Flag Ft. Meade
Thanks Meter: 1
 
657 posts
Join Date:Joined: Jul 2009
More
Can someone sticky this thread. Now I have ADB & fastboot on my Win7, Ubuntu, and OS X Partition. Thank you wddglr.
17th July 2009, 08:18 AM   |  #8  
Senior Member
Thanks Meter: 0
 
129 posts
Join Date:Joined: Jun 2009
bravo...linux rocks even better now!...
17th July 2009, 06:38 PM   |  #9  
savethechicken's Avatar
Senior Member
Flag Albuquerque
Thanks Meter: 0
 
244 posts
Join Date:Joined: Jan 2009
More
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.

The onlything that is not clear and/or confuses me is

Setting up the udev to recognize the device.

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
Last edited by savethechicken; 17th July 2009 at 06:44 PM.
17th July 2009, 09:01 PM   |  #10  
wddglr's Avatar
OP Member
El Paso, TX
Thanks Meter: 17
 
77 posts
Join Date:Joined: Jan 2009
More
Quote:
Originally Posted by savethechicken

Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.

The onlything that is not clear and/or confuses me is

Setting up the udev to recognize the device.

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.

It happens to me also from time to time. especially when i reboot and want to go into adb while the device is rebooting. although that file, 51-adndroid.rules, is what helped me get adb to recognize the device. the guide on developer.android.com talked about 50-android.rules but after a few deep searches i found this: http://groups.google.com/group/andro...3488c601243686

Post Reply Subscribe to Thread

Tags
sdk adb fastboot ubuntu
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes