Jump to content



About The Author
Nicole Watkins
Nicole Watkins is a 27-year-old history major working on her graduate degree in medieval British history.  She lives in Birmingham, AL and is hopelessly obsessed with Doctor Who.  Nicole resides with her husband, their dog, cat, two rabbits, and absurd amount of fish.  Her first love in the computer world will always be Linux, and she continues to avoid Windows as much as possible.  After buying her first Android phone in 2010, she was exposed to the wonderful world of rooting and customization, and could never see herself owning any other platform.  She hopes to provide further insight into the amazing open-source community and looks forward to learning more every day.

The Ubuntu Way: A New, Easier Method for Setting Up ADB and Transferring Files

Time for a personal confession: I hate using Windows. I think Android and Linux go together like peas and carrots, or whatever that famous movie said. Because Android is so Linux-based, with similar file structures and terminal commands, it is worth any Android enthusiast's time to learn some basic Linux tools. One of the most commonly used Linux distributions is Ubuntu; it's extremely user-friendly, and you might actually be surprised how easy doing work involving ADB on your phone can become once you invest a brief amount of time in Ubuntu. The biggest complaint I usually hear regarding ADB is that it's an enormous pain to get it installed and set up properly, and then there are those dreaded driver issues. One RootzWiki developer and script writer, Tahl, has written a script for use in Ubuntu that can make your life a lot easier.

I know some of you will be running scared, and I don't blame you. When I started using my first Linux distribution, I had no idea what I was doing, and I stayed away from terminal like my existence depended upon it. However, if you're already using Ubuntu, even casually, this is worth your time. You only have to type a few commands in terminal, and then you'll be given a very thorough walkthrough from there. For those of you who have used scripts like LeanKernelTweaks by user jakebites, the menu options are extremely similar and simple to navigate. Given what most users have to go through getting the proper drivers installed in order to get the SDK installed and use ADB, the opportunity to avoid some of these steps in Ubuntu is worthwhile. The script makes all of these steps incredibly simple for you.

This script will install the latest version of the Android SDK, NDK, will automatically install and symlink ADB and fastboot, and will install the ability to right-click to push files to ADB. The last item of this installation script is the ADB file transfer option that has been integrated into Nautilus (the Ubuntu file manager) for you. I'll be going into a more lengthy description of the installation process in a moment, but after running the script, you are now able to right-click on files in any folder on your computer and push them to ADB without using terminal. You can specify which folder you would like to send the files to or choose from a list of preset folders, including Download, Movies, Pictures, Music or the root of your SD Card. You can even push multiple files at a time. An even nicer bonus to this GUI-based ADB push method is that the developer has created a way for you to install .apks directly from your computer.

So, how is all this done? The developer explains in his forum post, but I'll be going into a brief tutorial for those who would like it here.

Things You Will Need
  • You will need to have Ubuntu installed. Several users have reported the script to be working with Linux Mint as well, so if you happen to be using Mint, feel free to give this a go!
  • You will need an Android device. The script is optimized to work with the Galaxy Nexus and designed around getting MTP functioning well in Ubuntu, but it should work with any device.
  • You will need a USB cable.
  • You will need to download the script from this link here.
After you download the script file (called andadb.sh), open terminal. I know to some of you this sounds scary, but it gets easier in just a few minutes, so stick with me! Since the script will have downloaded to your Downloads folder, type the following in terminal: (line break indicates that you should hit enter; e.g. type cd Downloads, hit enter, type the next command, hit enter)

cd Downloads
chmod +x andadb.sh
./andadb.sh

A menu that looks like the following should pop up:

Attached Image: andadb2-1.png


From here, the script is pretty self-explanatory. As I mentioned, for those of you familiar with scripts that are run specifically on your Android device, you will not be strangers to this sort of menu. You will want to begin by running the first option, and you will be asked to enter your password. Immediately afterward, I would recommend you go get a coffee. It's going to be awhile. The developer writes in his forum post that depending on how fast your connection is to the Ubuntu repository, running the first option can take around 30 minutes. I can confirm this based on my own installation.

Once Option 1 finally finishes, it's time to install the Android SDK and NDK, or Option 2. Once you select it, you'll be taken to some screens that look like the following:

Attached Image: Screenshot at 2012-03-12 02:45:56.pngAttached Image: Screenshot at 2012-03-12 02:46:52.pngAttached Image: Screenshot at 2012-03-12 02:46:59.pngAttached Image: Screenshot at 2012-03-12 02:47:11.pngAttached Image: Screenshot at 2012-03-12 02:48:24.pngAttached Image: Screenshot at 2012-03-12 02:48:30.pngAttached Image: Screenshot at 2012-03-12 02:48:36.png


If you're unfamiliar with installing the SDK and haven't done this before, the second screenshot is the menu where you pick which tools you want to install. The only tools you need for ADB to work are the Android SDK Tools, Revision (whatever number) and Android SDK Platform-tools (highlighted in the third screenshot). Whatever else you choose to install is up to you. Feel free to accept all the packages, but be aware the installation will take longer if you do. After you accept the packages you've chosen, ADB server will stop; this is completely normal. You will receive a notification that Android Tools have been updated; if you aren't planning on using Eclipse, feel free to ignore this message. When everything is completed, close the SDK Manager (see final screenshot). After you close the SDK Manager, the third option in the script will install ADB and fastboot for you.


Option 4 in the script installs Nautilus right-click ADB push support. This is what I mentioned earlier on in this article. After you finish installing the options in the script, when viewing files in the file manager in Ubuntu you will be able to right-click to perform a variety of options using ADB while your Android device is connected:


Attached Image: adb_push-gui.jpg


Option 5 in the script will install MTP support for the Galaxy Nexus. This is pretty straightforward. The newest version of Ubuntu will support MTP out of the box, so this will soon become unnecessary, but for now it's fairly useful. Personally, I found myself preferring the developer's new ADB method of file transferring since it is much faster than MTP, but the option is there for those who prefer it. MTP support will create a "GalaxyNexus" folder in your home directory. When connecting your Nexus with a USB cable, you can open up terminal and type "android-connect" (without quotes) to mount your device.


Option 6 will create and update the 99-android-rules file. The best way to explain this is probably simply to say this is similar to Windows drivers. It will help allow Ubuntu to determine which of your devices is connected via ADB.


Options 7 and 8 will install aapt, apktool, and git-repo. If you don't know what those things are, feel free to either install them or ignore them! They are primarily for development purposes.


Congratulations, you're all done! If you want to test to see if your phone is recognized through ADB, feel free to type "adb devices" (without quotes) in terminal. You should see your device (represented by some numbers) under "List of devices attached." You can also test if ADB is working properly by using the new file transfer option that you just installed. A good way to check is by right-clicking on a picture or wallpaper and pushing it to your device and checking your device to make sure if it's there!


As you can see, this is fairly painless. Part of the reason I chose to do a walkthrough is that I know Ubuntu can be uncharted territory for some people, but in many ways, it's significantly easier to get work done on your Android device using a Linux distribution. Installing the SDK and getting ADB set up properly can be a painful process. This script simplifies everything for you and walks you carefully through each step, and gives you a quick new way of transferring multiple files and installing apps in the process.


Feel free to check out the forum thread here!

via [The Forums]

blog comments powered by Disqus