tagged under android
I write this article to explain some cool things you can do with your android phone(any android phone) using ADB. ADB(or Android Debugging Bridge) is a tool used to connect and sends commands to your android phone from a computer. In this article I will be explaining with examples what you can accomplish on your android phone using ADB.
The caveat here is that, the ADB examples that I give you here assume that your phone is rooted. Rooting a phone simply means that you are granted superuser priveleges to your phone. It should however be noted that rooting your phone may void warranty. The procedure for rooting varies from phone to phone. The specific procedure for your phone can easily be found on the internet, so I won't be concentrating on that here. I will assume that your phone is rooted. I will also assume some degree of familiarity with basic linux commands.
Installing the ADB tool -- Method 1
- ADB is available on the Android Software Development kit. Download the package for your platform and install(.exe on windows) or extract to your favorite location on linux.
- Once installed or extracted, cd to the installation directory and launch SDK Manager.
- Check the platform tools option and uncheck all other options, unless you are developing apps on android.
- The platform tools including adb will be downloaded and installed.
Once installed, the adb tool is available in the platform-tools/ directory inside the android SDK directory. Make sure to add this to the PATH on linux or windows. On linux, you can modify your ~/.bashrc to contain the following line
On windows you can edit the Path system environment variable by searching for "system environment variable" in the windows start menu and appending the corresponding path of platform-tools/ to it.
To bring the PATH to immediate effect in linux, run the following command from a terminal(or log-out and log back in).
$ source ~/.bashrc
That's it. You are now ready to run the adb tool !!!.
Installing the ADB tool -- Method 2
- If you are not interested in any android development and do not want anything to do with the Android Software Development kit, you can just download the adb tool as a standalone tool. This ofcourse, is not official.
- Download a zip file containing some important adb tools.
- Extract the contents to any place you wish.
- Then similar to the Method 1 above, add that directory to which you extracted the contents of the .zip into the PATH environment variable, and you are done!!!.
Once ADB is installed, connect your phone via USB cable to your computer. Make sure, android debugging is enabled on your phone and make sure you have enabled installing of apps from third party sources on your phone.
Testing adb in linux
Fire up a terminal and type in the following commands in that sequence.
$ sudo -s $ adb kill-server $ adb root $ adb devices
You should now be able to see your phone listed under the list of devices attached
You can now access your phone's file system as shown below.
$ adb shell # ls
Notice that when you are inside the adb shell, you have a hash prompt as opposed to a dollar prompt when you are not. You should now be able to see the root directory of your phone. You can now use several standard linux commands to play around with the files on your phone. You can run pretty much every linux file management command when you are at the hash prompt. Once you are done, you can drop out from the ADB shell by pressing CTRL-D on linux. You will be taken back to the dollar prompt.
For most of the following examples, you will need your phone's file system to be in R/W mode. So, do that now:
$ adb remount
Now that we have adb tool running, let us look at some cool things you can do with it. At least, this is what I do on my rooted phone using ADB :)
Using ADB to do cool things
Changing the boot animation of your rooted android phone
Several beautiful boot animations are available here. Of course, there are many others available freely on the internet. As a matter of fact, it is not very hard to create one yourself. To put simply, the boot animations consists of several individual image files and another text file that tells in what order to display these images and the delay between them. Thats it!!!.
Once you have downloaded the zip file of the boot animation corresponding to your devices' resolution, make sure you rename it as bootanimation.zip
Suppose you have saved the zip as ~/bootanimation.zip. Type in the following commands at the terminal to set your new bootanimation.
$ adb push ~/bootanimation.zip /system/media/ $ adb reboot
That's it!!!. Your phone will now reboot, and you should be able to see the new boot animation in action.
Push files into or pull files from your android phone(also applies to directories)
You can pull files from your android phone to your computer using:
$ adb pull <src path on phone> <dst path on computer>
Or you can push any file from your computer into your android phone as follows:
$ adb push <src path on computer> <dst path on phone>
For example if you want to push ringtones from ~/Ringtones/ on your computer into your android phone, just do:
$ adb push ~/Ringtones/ /system/media/audio/Ringtones/
Similarly, you can push Alarms and Notification sounds to /system/media/audio/Alarms/ and /system/media/audio/Notifications/ directories on your phone respectively.
You may be wondering what is it that ADB can do that many android file manager apps like Astro file manager cannot do. The answer is ADB allows you to modify system files as well(those that reside in /system/).
You can also push(or pull) any files into your sdcard as follows:
$ adb push ~/names.txt /sdcard/ $ adb pull /sdcard/songs/abc.mp3 ~/Desktop/
Disable the annoying camera shutter sounds
This feature is not available in the camera app for ICS roms currently, and the only way to accomplishFor this, is to modify a single system sound file, which is as easy as shown below:
$ adb shell # cd /system/media/audio/ui # mv <shutter_sound_file> <shutter_sound_file>.old
By renaming the corresponding file, android can no longer find the sound files for the camera shutter and as a result, won't play the sound. Press CTRL-D to return to dollar prompt.
Install paid android apps for free
Although this is illegal, I use ADB quite exclusively for this purpose!!!. I have identified two superb sources for downloading paid android apps for free. One is 4shared and the other is Filecrop. Search for the name of the app as present in the android market and then download the latest version of the android app. It is usually a file with the extension .apk
Suppose you have downloaded the apk file to ~/Desktop/test.apk you can install it on your phone in one step as follows:
$ adb install test.apk
Voila!!!. You have just installed a paid android app for free!!!.
Similarly you can very easily unistall apps from your android phone using:
$ adb uninstall <package name>
In short, you can run pretty much every linux command that you use on your computer's linux file system, to manage files on your android phone which can be very powerful when managing large number of files using regular expressions, which is just not possible on your native android file manager app. If you have any trouble at all using adb with your phone, feel free to leave a comment below. I will try my best to sort things out for you. :)
« older posts newer posts »
other articles you might like
Share this post ⇒