ADB shell command
To put it simply, the ADB command is a command that comes with the ADB program, while the ADB shell is a command from the Android system that is called, and these commands are placed in the System/bin directory of the Android device, as in the command line. Command:
[Email protected]:/# adb Shell JJJ
ADB Shell JJJ
/system/bin/sh:jjj:not found it is clear that this command does not exist in the bin directory.
Want to see what commands, and do not want to find the document, so start the emulator, the entire System/bin directory is copied out, and then one by one to try.
C:\USERS\ADMINISTRATOR>ADB Pull/system/bin/e:\system-bin
Opening these files will reveal that some of the commands are actually a shell script, such as opening the monkey file:
Open am:
Pm
Package Manager, which can be used to get some application information installed on Android devices
PM Source Pm.java, directly run adb shell PM can get help information to this command
PM List package Lists the apps installed on the device
Without any options: Lists the package names for all apps
-S: List system applications
ADB shell PM List package-s
-3: List third-party apps
ADB shell PM List package-3
-F: List the app package name and the corresponding APK name and storage location
ADB shell PM List package-f
[Email protected]:/# PM List package-f
PM List package-f
Package:/system/app/soundrecorder.apk=com.android.soundrecorder
Package:/system/app/sdksetup.apk=com.android.sdksetup
-I: Lists the app package names and their installation sources, showing examples of the results:
ADB shell PM List package-i
Package:com.zhihu.android Installer=com.xiaomi.market
ADB shell PM List package-i
The command ends with the grep keyword, which makes it easy to find the app you want
parameter combinations, for example, to find the name of the package that you know in the three-party app, the APK storage location, and the installation source:
[Email protected]:/# PM List package-f-I fused
PM List package-f-I fused
Package:/system/app/fusedlocation.apk=com.android.location.fused Installer=null
PM Path lists the. apk location for the corresponding package name
[Email protected]:/# PM Path com.android.smoketest
PM Path com.android.smoketest
package:/data/app/smoketestapp.apk
PM list instrumentation, which lists the applications that contain the unit test case,
Can be followed by parameter-F (as in the PM list package), and [Target=package]
PM install, installing the app
The target apk is stored on the PC side, please install it with ADB installation
Target apk is stored on Android device, please install it with PM install
PM Uninstall, uninstall the application, with ADB uninstall, followed by the parameters are the package name of the app
Amam Start Program name, starting an Activity, started the system camera application as an example
Start Address Book
[Email protected]:/# AM Start com.android.contacts
Am Start com.android.contacts
starting:intent {Act=android.intent.action.main CAT=[ANDROID.INTENT.CATEGORY.L
Auncher] Pkg=com.android.contacts}
Start Dialer Dial 10086
[Email protected]:/# am START-A android.intent.action.call-d tel:10086
Am Start-a android.intent.action.call-d tel:10086
starting:intent {Act=android.intent.action.call dat=tel:xxxxx
Am Monitor, monitor crash (Flash back) and ANR (application not responding)
[Email protected]:/# AM Monitor
AM Monitor
Monitoring activity Manager ... available commands:
(q) Uit:finish monitoring
Input
This command can send key events to the Android device, and its source Input.java
Input text, send textual content, cannot send Chinese (if keyboard is set to English keyboard first)
[Email protected]:/# input Text testrabbit
SCREENCAPADB Shell screencap-p/sdcard/screen.png command
Screenshot, save to SDcard directory
[Email protected]:/# screencap-p/sdcard/screen.jpg
Screencap-p/sdcard/screen.jpg
See below:
Getprop
View parameter information for Android devices, run only adb shell Getprop, and result in Key:value key-value pairs
ADB Shell Getprop RO.BUILD.VERSION.SDK
Get the SDK version of the device
ADB Shell Getprop ro.build.version.release
Get the phone system version:
Learning Communication qq:270224761 (EP)
Android Common ADB command Summary (ii)