ADB tips.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 26 May 2014 16:20:17 +0300
changeset 1582 1551e7edcfa0
parent 1579 70096c1070db
child 1583 46a6bc1e9f2a
ADB tips.
android.rst
--- a/android.rst	Mon May 19 08:24:05 2014 +0300
+++ b/android.rst	Mon May 26 16:20:17 2014 +0300
@@ -51,4 +51,54 @@
   http://teamw.in/project/twrp2
     Custom recovery built.
 
+ADB tips.
+=========
 
+List available devices::
+
+  $ adb devices
+
+Install application from ``.apk`` file::
+
+  $ adb install -r /path/to/application.apk
+
+List installed package names::
+
+  $ adb shell 'pm list packages -f'
+
+Uninstall application by it name::
+
+  $ adb uninstall PACKAGE_NAME
+
+List currently run activities::
+
+  $ adb shell 'dumpsys activity'
+
+Find activities from package::
+
+  $ adb shell 'pm list packages -f'
+  $ adb pull APK_FROM_LIST
+  $ aapt dump badging APK_FILE
+
+Start an activity::
+
+  $ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE
+  $ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY
+
+Take a screenshort::
+
+  $ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
+
+Power button::
+
+  $ adb shell input keyevent 26
+
+Unlock screen::
+
+  $ adb shell input keyevent 82
+
+Show system log::
+
+  $ adb logcat
+  $ adb logcat "*:W"
+