Android Mods

March 31, 2013

[Tutorial] – ADB Commands, Tutorial Guide

SONY DSC

When it comes to Android modding, most novice users are confused or left wondering by reference over reference to a certain “adb”. This is especially true when you are looking up something on modding your device, or root it in particular. ADB is the wonder toy of Android and everyone seems to love it, so lets have a look at understanding what it is and why you need it, and how you can get it.

What Is ADB

ADB stands for Android Debug Bridge. Very useful program made by Google for Programmers and developers. It comes as a part of the standard Android SDK, which you can grab here. Basically, it provides a terminal-based interface for interacting with your phone’s file system. Since Android platform is based on Linux, command-line it’s often required to perform certain advanced operations on your device using root access.

While these things can be done directly on the device itself using some terminal emulator, it will be rather difficult to execute complex commands on such a small screen. ADB provides the bridge between your machine and your computer.

Android Debug Bridge

Its based on command line and basically communicates with your Android to respond to certain commands. There is vast amount of knowledge about adb but its most useful commands limit to getting:

Logcat:-

A real time log of what is happening in background of our devices. It is really useful for developers to see which component has malfunctioned and helps to narrow down their search for what failed and what needs to be fixed. Several times users are asked to give logcats of their devices which are giving errors. We will go in detail that how to get logcats in every and easiest way possible.

App Installation and Management:-

adb proves really handy if you want to install apks directly from your PC or want to batch install or delete them.

Shell Execution:-

You must have heard of Terminal Emulator. It is an app for android to execute shell commands(linux commands) which are basically present as applets in /system/bin, /system/sbin or /system/xbin(in our case) folders. A very important applet called busybox is installed there mainly used for execution of basic commands during root browsing or ROM installation. Many times updater script of ROMs use busybox commands to install it. Well, these commands can be initiated from your device too but they can be initiated from adb also making it easy for programmers.

Pushing and Pulling:-

Most used commands of adb. adb makes it a piece of cake for new device developers to get an ideo of structure and basic knowledge of devices by pulling command. We can pull out i.e copy any files or folders from our devices to our PC, even the root directories without rooting the devices. It help rooters and ROM chefs of new devices to get an idea and implement their mods on them. Pushing is also very useful command. It copies your files and folders from PC to your device. Very useful in pushing some /system apps and other things

Remounting and setting permissions

Basic commands:-

Of-course basic commands such as rooting and rebooting in recovery ode and download mode are supported.

Others:-

There are several other features of adb such as fastboot, aapt, etc

adb proves really handy if you want to install apks directly from your PC or want to batch install or delete them.

Shell Execution:-

You must have heard of Terminal Emulator. It is an app for android to execute shell commands(linux commands) which are basically present as applets in /system/bin, /system/sbin or /system/xbin(in our case) folders. A very important applet called busybox is installed there mainly used for execution of basic commands during root browsing or ROM installation. Many times updater script of ROMs use busybox commands to install it. Well, these commands can be initiated from your device too but they can be initiated from adb also making it easy for programmers.

XDA Senior Member Iamareebjamal has put together a thorough explanation of how to get ADB set up and the most commonly used commands to manipulate your device and gather those crucial logcats for developers.

There are a multitude of different things that you can achieve via ADB, from rebooting the device into various states, pushing/pulling & installing/uninstalling files, and even backing up your device. It also allows you to execute what’s known as an ADB shell and navigate the file structure using commands that Linux users will be familiar with.

Quite possibly the most useful function of ADB from a development point of view is the ability to generate a complete real time log of what is happening on the device at any given time. Step into any development thread here on XDA, and there’s a pretty good chance you’ll find someone being asked to provide a logcat. As the old saying goes, logcat or GTFO.

All of these commands and more are explained in detail (link below). So check it out if you’re new to ADB or just looking for a little refresher course.

Iamareebjamal has put a lot of time and effort into this write-up and warrants a hi5 for his work

Credits also to paxChristos for the logcat guide.

XDA_LOGO_iFeature_Carousel_80x80

ADB PAGE

 

Be Sociable, Share!

The following two tabs change content below.
avatar

Dave Thornton

Senior Editor

Senior Editor
Been involved in technology for many years, more than I care to remember. Live in Dundee, Scotland. I like Android, Windows Phone OS, BlackBerry OS and iOS, and love writing about all things techie. Currently have a Honor 6+, Elephone P6000, Nexus 5, Chrombook C720, HTC One M7, Nokia Lumina 625, Microsoft Lumia 435, Blackberry Q10, HTC Hero and iPad mini