Skip to content

Instantly share code, notes, and snippets.

@nprussell
Created June 24, 2015 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nprussell/4167e8d0b0e5098fc6f0 to your computer and use it in GitHub Desktop.
Save nprussell/4167e8d0b0e5098fc6f0 to your computer and use it in GitHub Desktop.
Here’s a list of some of the most useful adb and shell commands, when working with Android. Please feel free to add anything you think might be useful in the same format as the existing items.
NOTE : Shell commands can be run directly from adb by prepending adb shell to the beginning. Commands that require root will need adb shell su -c prepending.
$ ls -lR /dev/block
Outputs the entire contents of dev/block, recursively, including by-name and by-num blocks. This is extremely useful when trying to find out which mmc block different partitions are on.
$ cat /proc/mounts
Lists all mounted partitions (ext4, vfat, etc). Useful for quickly finding which mmc block system/data is on, and also useful for checking if system/data is mounted as read-write.
$ cat /proc/partitions
Lists block names by number of blocks.
$ echo $bootclasspath
Useful for deodexing builds. This command will echo out the entire bootclasspath. Google bootclasspath if you’re unfamiliar with this terminology.
$ cat /data/system/packages.xml | grep com.packagename.whatever
If you know the package name in its com.whatever format, and wish to locate the APK name to remove/modify it in the build, this command will provide that.
$ am start -n com.ultimobile.updater/com.ultimobile.updater.ui.MainUpdaterActivity
Launches a specific activity without opening the application on the device. This has to be done in the format above. Full package name/Activity name including package name.
$ stop
Stops system completely.
$ insmod /system/lib/modules/module.ko
Initializes a module directly. Useful when diagnosing kernel/hardware issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment