5,596,431 Members 39,571 Now Online
XDA Developers Android and Mobile Development Forum

{Tutorial} (Basics of ADB) For Beginners Part-1

Tip us?
 
doctor_droid
Old
(Last edited by doctor_droid; 11th October 2013 at 07:16 PM.)
#1  
doctor_droid's Avatar
Recognized Contributor - OP
Thanks Meter 1586
Posts: 3,581
Join Date: Oct 2012
The purpose of this thread is to make u familiar with the ADB (Android Debug Bridge)
It is a tool that lets u communicate with ur android device that is connected to ur pc.

In the first tutorial we shall learn some basics of adb and then advance to use pro commands in further tutorials.

Requirements

1. Adb link - http://developer.android.com/sdk/index.html
Direct link for windows 32bit
http://dl.google.com/android/adt/adt...6-20130917.zip

Direct link for windows 64bit
http://dl.google.com/android/adt/adt...4-20130917.zip

(Link may be removed after some time by google itself)

2. Windows based pc ( yes we will use windows and not linux as i dun want to communicate anything that i havent tried by myself )


1. Download and extract the zip in any drive , lets say C:

2. Go to C:/adb/sdk/platform-tools and u will something like
Attachment 1937059



3. Now press shift key + right click on mouse/keypad
http://forum.xda-developers.com/atta...1&d=1367732560
select open command window here

then type adb start-server

in order to ensure ur device is connected and recognized by adb , type adb devices , u will get something like this
Click image for larger version

Name:	adb devices.jpg
Views:	2105
Size:	117.7 KB
ID:	1940190

Now once your adb is setup up, lets play.....

GETTING LOGCAT THROUGH ADB


Easiest of all
just type
adb logcat

u will see entire log ur phone,
use ctrl+c to skip it

To get logcat in a file
type
adb logcat > logcat.txt

u will see a file logcat which will save ur phone's realtime process log.

TO GET A BUGREPORT


type adb bugreport
bt bt bt.. this will show info that wont b readable ..
so type

adb bugreport>result.txt

http://forum.xda-developers.com/atta...3&d=1367737608


USING ADB WITH SUPERUSER PERMISSIONS

for this , u must be rooted

command

adb root
if it is success it will show something like

http://forum.xda-developers.com/atta...1&d=1367740210



INSTALLING AN APP VIA ADB

to install any app, make sure there is no space in the name of the apk...
and u should know its location,

command that u use is adb install

i have installed a game papertoss via this command, if u get success u will get something like this

Attachment 1936893
Click image for larger version

Name:	adb install.jpg
Views:	1172
Size:	118.2 KB
ID:	1940189

COPYING A FILE VIA ADB


this is pretty easy

command u use is

adb pull
i have given a example by pulling the framework-res.apk from system/framework folder
Click image for larger version

Name:	adb pull.jpg
Views:	1229
Size:	248.8 KB
ID:	1940191

the file that u pull, u will see it in the platform -tools folder


PUSHING A FILE INTO YOUR PHONE


very similar to pull, bt this copies file from ur pc to ur android .

command u use is

adb push

For eg,
i have pushed the papertoss.apk file from C:\sanket\apps to sdcard/nimbuzz folder through the command

adb push C:\SANKET\apps\papertoss.apk /sdcard/nimbuzz

if u get success u will see something like this
http://forum.xda-developers.com/atta...1&d=1367739756

this command is very powerful and u can shift an entire video or movie folder via a single command anywhere on ur android


more commands added
thanks to @Guich


Code:
adb remount
This command remount the /system partition in read/write

Code:
adb usb
Restarts the adbd daemon listening on USB

Code:
adb shell
Run remote shell interactively

The command set shall b updated within few days.
Feel free to drop ur comments, corrections, commands.

All commands have been verified by me..
once i learn more, i will share more.
criticism is welcomed if its healthy

Thread material is not copied and will never be.
Thread will be updated with newer and complex commands soon with pics.

For developers, this is just a piece of cake which they can do with their eyes closed
i have made this specially for beginners ( like me )
The Following 44 Users Say Thank You to doctor_droid For This Useful Post: [ Click to Expand ]
 
doctor_droid
Old
#2  
doctor_droid's Avatar
Recognized Contributor - OP
Thanks Meter 1586
Posts: 3,581
Join Date: Oct 2012
reserved for future
The Following User Says Thank You to doctor_droid For This Useful Post: [ Click to Expand ]
 
Guich
Old
#3  
Guich's Avatar
Recognized Contributor
Thanks Meter 2933
Posts: 4,186
Join Date: May 2012

 
DONATE TO ME
Good job!

I think you can add in op this command:

Code:
adb remount
This command remount the /system partition in read/write

Code:
adb usb
Restarts the adbd daemon listening on USB

Code:
adb shell
Run remote shell interactively

Code:
adb devices
List all connected devices


Anh, adb will work in recovery too, write it in op if you want
The Following 4 Users Say Thank You to Guich For This Useful Post: [ Click to Expand ]
 
freakboy13
Old
#4  
freakboy13's Avatar
Senior Member
Thanks Meter 399
Posts: 1,730
Join Date: Sep 2010
Wow this a great tut!
Def gonna link back to this!
Thanks a lot for making this!
:beer:
" A Galaxy without Android is like a ship with out water...."
ALERT ---> KIES 2.xxx or KIES 3 for the Galaxy note 3:
EFR TOOL and UPDATE TOOL WILL NOT work with AT&T Galaxy Note 3

Got A Samsung and Soft bricked it?
Panicked cuz ya bootlooped yer new phone?
Or maybe you just want THE FASTEST and EASIEST way back to stock rom with out using Odin?
Then click my tutorial: :thumbup:
CLICK-----> EFR<-----CLICK
 
ensXP
Old
#5  
ensXP's Avatar
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Apr 2012
Location: Belgrade
Tnx for great tutorial... great stuff for noob like me to begin with

Sent from my Desire HD using Tapatalk 2
 
XperienceD
Old
#6  
XperienceD's Avatar
Senior Member
Thanks Meter 2258
Posts: 7,085
Join Date: Jul 2010
Location: Here =)
I'd use a Image Hoster for your pics, then you wont get "invalid attachment" errors.
X10 -|- ARC -|- RAY -|- Z -|- Z1 COMPACT


Do XDA a favour and type your "how to -insert mod here" into Google before starting new threads.
 
doctor_droid
Old
#7  
doctor_droid's Avatar
Recognized Contributor - OP
Thanks Meter 1586
Posts: 3,581
Join Date: Oct 2012
Quote:
Originally Posted by XperienceD View Post
I'd use a Image Hoster for your pics, then you wont get "invalid attachment" errors.
there are just 6 pics which are visible (atleast in tapatalk)
rest non working links are to b removed ;
 
Ciphersbak
Old
#8  
Ciphersbak's Avatar
Member
Thanks Meter 8
Posts: 49
Join Date: Feb 2013
Great stuff m8 :thumbup:

How about including backup and restore commands

Sent from my Nexus 7 using Tapatalk HD
 
supergerrit
Old
#9  
supergerrit's Avatar
Junior Member
Thanks Meter 0
Posts: 9
Join Date: Feb 2013
Thanks for this great tutorial. :thumbup:
 
golfgtiedition30
Old
#10  
golfgtiedition30's Avatar
Senior Member
Thanks Meter 258
Posts: 751
Join Date: Dec 2012
Thank you for this. It sounds alot easier than i thought :thumbup:

Sent from my GT-S5830 using xda app-developers app
Xperia Zed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes