浏览代码

adb-shell: add page (#4287)

Axel Navarro 4 年之前
父节点
当前提交
d103a229a7
共有 1 个文件被更改,包括 32 次插入0 次删除
  1. 32 0
      pages/common/adb-shell.md

+ 32 - 0
pages/common/adb-shell.md

@@ -0,0 +1,32 @@
+# adb shell
+
+> Android Debug Bridge Shell: Run remote shell commands on an Android emulator instance or connected Android devices.
+> More information: <https://developer.android.com/studio/command-line/adb>.
+
+- Start a remote interactive shell on the emulator/device:
+
+`adb shell`
+
+- Revert all runtime permissions to their default:
+
+`adb shell pm reset-permissions`
+
+- Revoke a dangerous permission for an application:
+
+`adb shell pm revoke {{package}} {{permission}}`
+
+- Trigger a key event:
+
+`adb shell input keyevent {{keycode}}`
+
+- Clear the data of an application on an emulator or device:
+
+`adb shell pm clear {{package}}`
+
+- Start an activity on emulator/device:
+
+`adb shell am start -n {{package}}/{{activity}}`
+
+- Start the home activity on an emulator or device:
+
+`adb shell am start -W -c android.intent.category.HOME -a android.intent.action.MAIN`