How To: Android SDK/ADB setup for lmde *Updated 1/29/11*

Write tutorials and howtos in here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this

How To: Android SDK/ADB setup for lmde *Updated 1/29/11*

Postby nemesis2all on Mon Jan 24, 2011 4:51 pm

This is a guide for adb setup on lmde. Most of the information comes from http://howto.ccroms.net/ This is just an updated guide with some changes to udev rules and a fix for if adb does not start with enough permissions for you.

*Please note for 64 bit users you may need to install 32 bit libs.
Code: Select all
sudo apt-get install ia32-libs


Download sdk from here http://developer.android.com/sdk/index.html

After download is complete run this code from terminal one line at a time.
Code: Select all
cd ~
mkdir android
tar -zxvf ~/Downloads/android-sdk_r09-linux_x86.tgz
mv android-sdk-linux_x86 ~/android/sdk


After the files have been moved it is time to update sdk so you'll have adb. This should open up the android sdk and avd manager. If you get some complaints about java you will need to install some packages for that. At the bottom of the guide I will post what packages you will need. If adb and avd manager started correctly go to the Available packages tab on the left hand side of that window. Select the boxes for Android repository and Third party Add-ons, when you have selected both boxes click on install selected. On the window that comes up after select accept all and apply for the license agreements and let it download and install all of the updates.
Code: Select all
cd ~
android/sdk/tools/android



After the sdk has been updated it is now time to set your path to include adb.
Code: Select all
cd ~
gedit .bashrc


Once the text editor is open you need to paste the following line into the file and then save and exit.
Code: Select all
export PATH=${PATH}:~/android/sdk/platform-tools


Next we will make sure .bashrc is executable.
Code: Select all
cd ~
chmod a+x .bashrc


Now it is time to setup our devices rules. I prefer to use all of these in case I have another android phone around to work on.
Code: Select all
cd ~
sudo gedit /etc/udev/rules.d/51-android.rules


In the text editor that opens up paste in the following rules. I prefer to use all of these in case I have another android phone around to work on. You can just use one specific to your phone if you choose. After you are finished save the file and exit.
Code: Select all
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"


Next we are going to make sure the rules are executable.
Code: Select all
cd ~
sudo chmod a+x /etc/udev/rules.d/*


Now for me after these steps were completed adb server was not starting with sufficient permissions. What I needed to do was add the full path to adb start-server in rc.local to fix this.
Code: Select all
cd ~
sudo gedit /etc/rc.local


Once that file is open add the following line above exit 0, then save and exit the file. Please note "sample" needs to be replaced with your user name.
Code: Select all
/home/sample/android/sdk/platform-tools/adb start-server


After this reboot your computer. ADB should now be working and available to you from the terminal when your phone is plugged in.

*If when trying to start sdk and avd manager you get complaints about java install these packages. When installing these packages you might get a box that opens up asking you to accept a license agreement. To accept the agreement hit the "tab" key to highlight <OK> and then hit enter.
Code: Select all
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
Last edited by nemesis2all on Sat Jan 29, 2011 2:42 pm, edited 8 times in total.
nemesis2all
Level 1
Level 1
 
Posts: 15
Joined: Sat Jan 15, 2011 3:06 am

Linux Mint is funded by ads and donations.
 

Re: How To: Android ADB setup for lmde

Postby darco on Mon Jan 24, 2011 5:35 pm

ahh, good to know...I already set it up in windoze tho...will try on a bored day :)
darco
Level 3
Level 3
 
Posts: 164
Joined: Sat May 24, 2008 5:03 pm

Re: How To: Android SDK/ADB setup for lmde

Postby marlar on Thu Jan 27, 2011 6:45 pm

Thanks for the guide, but I didn't know I had to do anything special. I just downloaded Eclipse and the Android SDK --- and it worked out of the box :)
marlar
Level 2
Level 2
 
Posts: 61
Joined: Thu Dec 10, 2009 9:30 am

Re: How To: Android SDK/ADB setup for lmde

Postby nemesis2all on Thu Jan 27, 2011 6:56 pm

marlar wrote:Thanks for the guide, but I didn't know I had to do anything special. I just downloaded Eclipse and the Android SDK --- and it worked out of the box :)


You are welcome. I am pretty sure eclipse sets up the udev rules for you etc. I do not have a need for eclipse tho so I usually have to go thru the extra steps.

Edit: Also if you plan on running adb from the directory you installed it in the path in .bashrc is not necessary, and if you plan on running adb as root the the line in /etc/rc.local is not necessary.
nemesis2all
Level 1
Level 1
 
Posts: 15
Joined: Sat Jan 15, 2011 3:06 am

Re: How To: Android SDK/ADB setup for lmde *Updated 1/29/11*

Postby Gamin92 on Sun Feb 05, 2012 1:12 pm

Tried to follow the tuto but when trying to launch sdk I get this, so can't have anything from repos...

Code: Select all
Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Failure initializing default SSL context
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-5.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-5.xml, reason: Failure initializing default SSL context
Done loading packages.


Any idea ?
Gamin92
Level 1
Level 1
 
Posts: 1
Joined: Mon May 23, 2011 9:58 am

Re: How To: Android SDK/ADB setup for lmde *Updated 1/29/11*

Postby alonsog on Tue Feb 21, 2012 4:40 pm

Gamin92 wrote:Tried to follow the tuto but when trying to launch sdk I get this, so can't have anything from repos...

Code: Select all
Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Failure initializing default SSL context
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-5.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-5.xml, reason: Failure initializing default SSL context
Done loading packages.


Any idea ?


I was getting the same issue.

You can try executing this:

Code: Select all
update-alternatives --config java


Then you will see a table with all available java runtime enviroments in your machine. Select
/usr/lib/jvm/java-6-sun/jre/bin/java
as default.

Now you can try android sdk manager, It worked for me.
alonsog
Level 1
Level 1
 
Posts: 1
Joined: Tue Feb 21, 2012 4:29 pm

Re: How To: Android SDK/ADB setup for lmde *Updated 1/29/11*

Postby stroom on Mon Sep 17, 2012 4:50 pm

thanks a lot, that was hard to find!
stroom
Level 1
Level 1
 
Posts: 3
Joined: Tue May 13, 2008 3:32 pm

Linux Mint is funded by ads and donations.
 

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 7 guests