Monday, 19 October 2015

ADB Common Commands (Android Debug Bridge)

A reference guide to using adb to control an Android device from Windows

Introduction

Here are some common commands I use to manipulate Android devices from the windows command line using adb. (Android Device Bridge) The reason this page exists is because I generally forget them about 5 minutes later. I hope they are helpful.
Download the adb tools from the Android developers web site, either with the Adroid studio or on their own.
http://developer.android.com/sdk/index.html
To use adb you do not have to root the device.

ADB Commands

adb devices - List all the connected Android devices serial numbers
adb install <filename>.apk - Install the specified package
adb uninstall <uri> - uninstall the application with the specifed identitifier
adb shell am start <full rui of activity you want to run) - run the specified application on the device, start with the specified activity. For example com.marcus.app/com.marcus.app.MainActivity
adb shell ls - List all files in the root folder on the device
adb shell "ls sys" - List all files in the sys folder on the device
adb shell "ls -d */" - List only folders on the device in root
adb shell "ls -al <folder>"  - List all the info of the folder on the device in root
adb shell "ls -al /mnt/shell/emulated/0" - List the contents of the first mounted device, usually SD card 0
adb shell "pm list packages" - List all packages installed on the device
adb shell "pm list packages | grep com.marcus" - List all packages installed on the device containing the identity com.marcus

Further Notes

If you want to manupulate the phone from a C# application, then see my other article !
Thats all folks.

No comments:

Post a Comment