Ubuntu 12.04 - Install Android Tools (ADB, Fastboot, ...)
Autor: Jorge Luiz Brito de Faria | Publicado: 2014-03-15T15:19:00-07:00

 


                    
            
  





 

  Ubuntu 12.04 - Install Android Tools (ADB, Fastboot, ...)
Created on 22 Feb 2013, 
 updated on 14 Aug 2013, 
 by Nicolas Bernaerts  
 
            // <![CDATA[
            function toc_toggle_visible(ob)
            {
              var ul = ob.parentNode.parentNode.getElementsByTagName("ul")[0];
              var d = ul.style.display == "none";
              ul.style.display = d ? "" : "none";
              ob.innerHTML = d ? "Hide"
                               : "Show";
              return false;
            }
            // ]]>
            Contents[Hide]
Setup ADB Udev Rule
Install Android tools Only
Install Android SDKInstall Oracle Java 7
Install ia32-libs
Install Android SDK

Allow ADB trusted connexion
Install QtADB


If you own an Android Smartphone, you will need sooner or later to use some specific Android tools like adb or fastboot.
If you need these tools, two options are now available under Ubuntu 12.04 :
Install the whole Android SDK which bring these tools among may other things
Install some specific android-tools packages that bring only these tools
This article will explain the simple steps needed to install Android tools, including latest Android SDK on a Ubuntu Precise 12.04 workstation.
Both options have been tested to Root a Google Nexus S and to Root a Google Nexus 7.
1.&nbsp;Setup ADB Udev RuleBefore accessing your android device in adb mode, you need to :
set the device to use USB Debug
declare a corresponding Udev rule on your Ubuntu box
After setting the device in USB Debug mode and connecting it to a USB port, throw the command :
# lsusb...Bus 002 Device 059: ID 18d1:4e42 Google Inc.This is the result for a Google Nexus 7 connected in MTP mode with USB Debug on. It gives the Manufacturer and Model ID.
Now that we have these data, we can create the udev rules in /etc/udev/rules.d/99-android.rules.
# sudo gedit /etc/udev/rules.d/99-android.rules/etc/udev/rules.d/99-android.rules# Google Nexus 7 16 GbSUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0666", OWNER="your-login" &nbsp;&nbsp; # MTP mode with USB debug onyour-login should be your Ubuntu session login.
We can now restart udev for the new rules to become operationnal.
# sudo service udev restart2.&nbsp;Install Android tools OnlyIf you don't plan to do some development on your android device, you don't need to install the complete SDK.
One android-tools package is now available on Ubuntu quantal.
Thanks to Web8upd site this package has been ported to Ubuntu precise and is available as a PPA.
So, to install the tools, you just need to declare the PPA and install the package :
# sudo add-apt-repository ppa:nilarimogard/webupd8# sudo apt-get update# sudo apt-get install android-tools-adb android-tools-fastbootThe tools are now available in command line.
3.&nbsp;Install Android SDK3.1.&nbsp;Install Oracle Java 7To install the complete Android SDK, first step is to install latest Oracle Java 7 runtime environment.
We also have to previously uninstall OpenJDK, as it is provided out of the box with Ubuntu Precise.
Oracle Java is not available in the official Ubuntu repositories anymore because that's not allowed by the new Java license.
We will get the help of WebUpd8 PPA to install it.
The package in the PPA automatically downloads (and installs) Oracle Java JDK 7 from its official website and installs it on the computer (it works like the flashplugin-installer).
# sudo apt-get purge openjdk*# sudo add-apt-repository ppa:webupd8team/java &amp; sudo apt-get update# sudo apt-get install oracle-java7-installer3.2.&nbsp;Install ia32-libsAndroid SDK still needs the 32bits compatibility packages to run.
So, if you are running an AMD64 distribution, you need to install the well-known ia32-libs package.
# sudo apt-get install ia32-libsThis will download hundreds of packages and take ages ...
3.3.&nbsp;Install Android SDKDownload Android SDK.
Extract it to one folder &amp; from that folder run these commands :
# cd ./tools# ./android sdkGet the default choice and start Install xx packages.
You are now running Android SDK on your Ubuntu box.
4.&nbsp;Allow ADB trusted connexionStarting from Android 4.2.2 onward, a new security feature has been introduced within ADB.
You must confirm on your device that it is being attached to a trusted computer before any dialog can take place.
This security feature need adb version 1.0.30 and above.
You can check easily your ADB version :
# adb versionAndroid Debug Bridge version 1.0.31# adb devicesList of devices attachedxxxxxxxxxxxxxxx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deviceIf your adb version is too old you'll get :
# adb devicesList of devices attachedxxxxxxxxxxxxxxx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; offlineWhen you will plug your Android device for the first time, it will display a message asking you to allow connexion to your computer as a trusted computer.
You need to validate the message and to select the permanent checkbox.
5.&nbsp;Install QtADBQtADB is an app based on adb. It requires working&nbsp; android sdk, Qt libs version 4.7, root and busybox installed on the Android device.
To use QtADB, it is very important to have your device rooted and to have installed Busybox from Google play. After installation, you need to launch BusyBox Free and start the Install procedure using smart install.Without these steps, half of QtADB functionalities won't work.
QtADB will allow you to :
have a complete access to your Android device filesystem
manage your installed applications
get some device informations (battery level, memory usage, ...)
take some device display screenshot
Before installing it you should install the dependencies :
# sudo apt-get install libqtgui4 libqt4-network libqt4-declarativeThen you need to get QtADB binary from http://qtadb.wordpress.com/download/.
Put the binary QtADB in a directory and make it executable.
The first time you launch it, it will ask for the directory where Android tools are installed (it depends on the fact that you used the PPA or the Google SDK).
You can now access your complete phone filesystem.
Be careful, you have the full powers !

   

   This article is published "as is", without any warranty that it will work for your specific need.If you think this article needs some complement, or simply if you think it saved you lots of time &amp; trouble,just let me know at 
 
 <!--
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy68749 = 'n&#105;c&#111;l&#97;s.b&#101;rn&#97;&#101;rts' + '&#64;';
 addy68749 = addy68749 + 'l&#97;p&#111;st&#101;' + '&#46;' + 'n&#101;t';
 var addy_text68749 = 'n&#105;c&#111;l&#97;s.b&#101;rn&#97;&#101;rts' + '&#64;' + 'l&#97;p&#111;st&#101;' + '&#46;' + 'n&#101;t';
 document.write('');
 document.write(addy_text68749);
 document.write('');
 //-->\n nicolas.bernaerts@laposte.net
 <!--
 document.write('');
 //-->
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 
 <!--
 document.write('</');
 document.write('span>');
 //-->
 . Cheers !&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;