Basic ADB commands , managing android mobile from PC.

 These are some command I use with ADB when connecting android mobile to PC.
All sources are from Google.
Step 1. You should have installed Android SDK and Android driver for your android phone
Step 2: Turn on ADB in the mobile . To do that, Go to Menu > Settings > Applications > Development > USB Debugging
Step 3 : Run ADB. From PC, run command prompt(better run as admin) and go to SDK directory in PC.
(\Android\android-sdk\platform-tools)
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)
adb devices (to see active devices)
adb -s <serialNumber> <command> (to direct communicate with specific device)
adb forward tcp:6100 tcp:7100 (Forwarding Ports)
[adb] logcat [<option>] ... [<filter-spec>] (Enabling logcat Logging)
ADB Shell Commands ( when we use adb shell)
cd (changes directories) -- cd /system/app
ls (lists all files in the directory) -- cd /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
$ adb shell monkey -v -p <your.package.name> 500(UI/Application Exerciser Monkey)
dumpsys (Dumps system data to the screen.)
dumpstate (Dumps state to a file)
dmesg (Prints kernel debugging messages to the screen)
start (Starts (restarts) an emulator/device instance.)
stop (Stops execution of an emulator/device instance.)
….. thanks….

No comments:

Post a Comment