Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP doctor_droid

6th May 2013, 01:56 PM   |  #1  
doctor_droid's Avatar
OP Recognized Contributor
Thanks Meter: 1,851
 
4,238 posts
Join Date:Joined: Oct 2012
More
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:	3538
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:	2054
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:	2163
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 )
Last edited by doctor_droid; 11th October 2013 at 08:16 PM.
The Following 58 Users Say Thank You to doctor_droid For This Useful Post: [ View ]
6th May 2013, 01:57 PM   |  #2  
doctor_droid's Avatar
OP Recognized Contributor
Thanks Meter: 1,851
 
4,238 posts
Join Date:Joined: Oct 2012
More
reserved for future
The Following 2 Users Say Thank You to doctor_droid For This Useful Post: [ View ]
6th May 2013, 04:45 PM   |  #3  
Guich's Avatar
Recognized Contributor / Themer
Flag Into Her Eyes...
Thanks Meter: 3,323
 
4,388 posts
Join Date:Joined: May 2012
Donate to Me
More
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 5 Users Say Thank You to Guich For This Useful Post: [ View ]
6th May 2013, 06:27 PM   |  #4  
freakboy13's Avatar
Senior Member
Thanks Meter: 401
 
1,730 posts
Join Date:Joined: Sep 2010
Wow this a great tut!
Def gonna link back to this!
Thanks a lot for making this!
:beer:
7th May 2013, 03:19 PM   |  #5  
ensXP's Avatar
Junior Member
Belgrade
Thanks Meter: 0
 
1 posts
Join Date:Joined: Apr 2012
More
Tnx for great tutorial... great stuff for noob like me to begin with

Sent from my Desire HD using Tapatalk 2
9th May 2013, 06:59 PM   |  #6  
XperienceD's Avatar
Senior Member
Flag Here =)
Thanks Meter: 2,438
 
7,361 posts
Join Date:Joined: Jul 2010
More
I'd use a Image Hoster for your pics, then you wont get "invalid attachment" errors.
10th May 2013, 03:57 AM   |  #7  
doctor_droid's Avatar
OP Recognized Contributor
Thanks Meter: 1,851
 
4,238 posts
Join Date:Joined: Oct 2012
More
Quote:
Originally Posted by XperienceD

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 ;
11th May 2013, 05:47 PM   |  #8  
Ciphersbak's Avatar
Member
Thanks Meter: 8
 
50 posts
Join Date:Joined: Feb 2013
More
Great stuff m8 :thumbup:

How about including backup and restore commands

Sent from my Nexus 7 using Tapatalk HD
11th May 2013, 06:56 PM   |  #9  
supergerrit's Avatar
Junior Member
Thanks Meter: 2
 
22 posts
Join Date:Joined: Feb 2013
Thanks for this great tutorial. :thumbup:
18th May 2013, 12:21 AM   |  #10  
golfgtiedition30's Avatar
Senior Member
Thanks Meter: 380
 
909 posts
Join Date:Joined: Dec 2012
Thank you for this. It sounds alot easier than i thought :thumbup:

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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes