• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root (How To) ADB commands

t0ast3d

Android Enthusiast
Aug 27, 2010
372
76
Oklahoma
If you find this helpful or think it would be helpful to others, tip it for a sticky!


Here's a little guide I put together for you to learn basic adb commands.


I'm posting this thread assuming you already have your SDK set up


With that said, let's dive right in!



1. Turn on ADB

Go to Menu > Settings > Applications > Development > USB Debugging


2. Running ADB

Open up command prompt and type your way to the directory you have your SDK in.

Mine is in C:\

So for example, mine would be: cd c:\AndroidSDK/tools

You are now in


3. Basic ADB commands

ADB push (sends files to your phone) -- adb push c:\example.apk /sdcard/example.apk

ADB pull (Receives files from your phone) -- adb pull /system/app/example.apk c:\example.apk

ADB install (installs application) -- adb install c:\example.apk

adb shell (Begins shell connection with phone)

adb reboot (reboots phone)

adb reboot recovery (reboots phone into recovery)

adb reboot bootloader (reboots the phone into bootloader/the white screen)

adb remount (remounts the system)


4. Commands to run while in ADB Shell

cd (changes directories) -- cd /system/app

ls (lists all files in the directory) -- ls /system/app

rm (removes files) -- rm /system/app/example.apk

cp (copies files) similar to cat -- cp /system/app/example.apk /sdcard/example.apk

cat (copies files) -- cat /system/app/example.apk > /sdcard/example.apk

exit (exits shell) -- exit


Might add a little more later if requested/clean it up

Hope you learned something!
 
:)

The ADB server is A server a background process on your development machine - e.g. Windows PC. The ADB server manages communication between the client and the adb daemon running on an emulator or device. The ADB commands that are essential to start ADB Server and connect to Device are:


Terminates the adb server process that is running in the background


ADB kill-server


Check whether the adb server process is running in the background. Start it if it is not running in the background:


ADB start-server


Know what emulator/device instances are connected to the adb server. Generate a list of attached emulators/devices:


ADB Devices


This command produces Device/Emulator serial number and itis state - whether online or offline.

:)
 
Upvote 0
You said your way to the directory to sdk is cd c:\AndroidSDK/tools ........................how come .What is cd supposed to be here ?

I mean basically shouldnt it be c:\"installation folder" or c:\program files\"installation folder"
If you find this helpful or think it would be helpful to others, tip it for a sticky!


Here's a little guide I put together for you to learn basic adb commands.


I'm posting this thread assuming you already have your SDK set up


With that said, let's dive right in!



1. Turn on ADB

Go to Menu > Settings > Applications > Development > USB Debugging


2. Running ADB

Open up command prompt and type your way to the directory you have your SDK in.

Mine is in C:\

So for example, mine would be: cd c:\AndroidSDK/tools

You are now in


3. Basic ADB commands

ADB push (sends files to your phone) -- adb push c:\example.apk /sdcard/example.apk

ADB pull (Receives files from your phone) -- adb pull /system/app/example.apk c:\example.apk

ADB install (installs application) -- adb install c:\example.apk

adb shell (Begins shell connection with phone)

adb reboot (reboots phone)

adb reboot recovery (reboots phone into recovery)

adb reboot bootloader (reboots the phone into bootloader/the white screen)

adb remount (remounts the system)


4. Commands to run while in ADB Shell

cd (changes directories) -- cd /system/app

ls (lists all files in the directory) -- ls /system/app

rm (removes files) -- rm /system/app/example.apk

cp (copies files) similar to cat -- cp /system/app/example.apk /sdcard/example.apk

cat (copies files) -- cat /system/app/example.apk > /sdcard/example.apk

exit (exits shell) -- exit


Might add a little more later if requested/clean it up

Hope you learned something!
 
Upvote 0
You said your way to the directory to sdk is cd c:\AndroidSDK/tools ........................how come .What is cd supposed to be here ?

I mean basically shouldnt it be c:\"installation folder" or c:\program files\"installation folder"

you do not have to have cd in front. unless you are in a different directory. the whole idea is that you point the command in the right path. so that where ever your adb folder is at that is where the command should be.

i find that if you right click while holding down shift and select open command window here option (only works in windows 7) to be the easiest way.
 
  • Like
Reactions: Robobob1221
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones