You are on page 1of 3

adb devices Shows a list of devices attached to the computer.

adb reboot Reboots a device connected to the PC.


adb reboot recovery Reboots a device into recovery mode.
adb reboot download
Reboots the connected device into download mode.
E.G Download mode on Samsung Galaxy devices.
adb reboot bootloader
Reboots a device into ootloader. !nce in ootloader"
you can ma#e further selections here.
adb reboot fastboot Reboots a connected device into $astboot mode.
Installing / Uninstalling / Updating Apps with ADB.
adb install
<ApplicationpathPackagename.ap
k
%D install let&s you install %P' files directly to your
phone. (o use this command type adb install
application path" as shown in the commands part and
hit enter #ey and it will start installing the app on your
phone. e.g adb install
!"/Users/Usama#/Desktop/!andy!r$sh%aga.apk.
)f process succeeds it will show you *Success+ in the
command window.
adb install -r
<AplicationpathPackagename>.apk
)f you have already installed an app" and you ,ust
want to update it then this command will let you do so.
e.g adb install &r
!"/Users/Usama#/Desktop/!andy!r$sh%aga.apk
adb $nistall package'namee.g
adb $ninstall com.android.chrome
-ninstalls and application from your device. (he
easiest way to find a pac#age name is" install Pac#age
.ame /iewer from the play store and find the name of
the pac#age under the %pp .ame. )f process succeeds
it will show you *Success+ in the command window.
adb $ninstall &( package'namee.g
adb $ninstall &(
com.android.chrome
-ninstall an app but #eeps it&s data and cache
directories. )f process succeeds it will show you
*Success+ in the command window.
P$sh and P$ll files
adb rootadb p$sh e.gadb p$sh
c")$sers)Usama#)desktop)%ong.mp*
)system)media
adb p$sh
filepathonP!/filename.e+tension
path.on.phone.toplace.the.file
the adb push commands let&s you transfer any files to
your phone from your PC. 0ou simply need to provide
the path of file on your PC and path where to place
this file on your phone.
adb rootadb p$lle.gadb p$ll Similar to the adb push command. -sing adb pull"
)system)media)%ong.mp
!")$sers)Usama#)desktop
adb p$ll ,Path of file on phone-
,Path on P! where to place the file-
you can simply pull any files from your phone.
Backing $p system and installed apps.
efore doing this" in your adb folder create a folder ac#up and under the bac#up folder create
two folders named System%pps and )nstalled%pps.
(hese folders are necessary as you&ll be pushing the bac#ed up apps to these folders.
adb p$ll /system/app
back$p/systemapps
bac#s up all the system apps of your phone to the
Systemapps folder that you created in the %D folder.
adb p$ll /system/app
back$p/installedapps
bac#s up all the installed apps of your phone to the
installedapps folder that you created in the %D
folder.
Backgro$nd .erminal
adb shell starts the bac#ground terminal.
e+it exits the bac#ground terminal.
adb shell <command yo$ wante.g
adb shell s$
switches to the root of your phone. Please ma#e sure
that you&re rooted in case you wish to use adb shell
su.
/astboot commands
(o flash files using fastboot" place the desired files in $astboot folder or Platform1tools folder
that you obtained after installation of %ndroid SD' tools.
/astboot /lash /ile.0ip
$lashes a .2ip file to your phone" when your phone is
connected in $astboot mode.
/astboot /lash recovery
recoveryname.img
$lashes a recovery to your phone when it&s connected
in $astboot mode.
/astboot flash boot bootname.img
$lashes a boot or #ernel image when your phone is
connected in $astboot mode.
/astboot getvar cid shows you the C)D of your phone.
/astboot oem write!ID +++++ writes the super C)D.
fastboot erase system
fastboot erase data
fastboot erase cache
)n case you want to restore a nandroid bac#up" you&ll
have to delete the current system3data3cache of your
phone first. efore doing this" it is always
recommended to have bac#ed up your system using a
custom recovery4bac#up option and copy the bac#ed
up .img files to $astboot or Platform1tools folder in
%ndroid SD' folder. (hen performing these
commands will erase everything.
fastboot flash system system.img
fastboot flash data data.img
fastboot flash cache cache.img
(hese commands will restore the bac#up that you
made using a custom recovery on your phone and
placed in the $astboot folder under %ndroid SD'
tools.
fastboot oem get'identifier'token
fastboot oem flash Unlock'code.bin
fastboot oem lock
(hese commands help you to get the identifier to#en
of your phone that can be used for unloc#ing the
bootloader. (he second command helps your to flash
the bootloader unloc# code" and the 5rd commands
helps you to loc# your phone&s bootloader once again
if loc#ing it is actually allowed.
1ogcat
adb logcat
Shows you the real time logs of your phone" these logs
represent the ongoing process on your device.)t is
recommended that you run this command while your
device boots up to chec# what&s going on.
adb logcat logcat.t+t
Creates a .txt file containing the logs in the Platform1
tools folder or $astboot folder in %ndroid SD' tools
directory.

You might also like