Android command ------- ADB command Daquan, android ------- adb
1. Display All simulators currently running: adb devices
2. start ADB adb start-server
3. Stop ADB adb kill-server
4. install the application: adb install-r [apk file]
-L # Lock the program-r # reinstall the program and save the data-s # install it in the SD card instead of the internal storage of the device
Example: adb install -- r D: \ mm.apk
5. uninstall the application: adb uninstall [packagename]
Example: adb uninstall com. tencent. mm
-K # Do not delete the data and cache directory generated by the program running (such as the database file of the software)
Example: adb uninstall-k com. tencent. mm
6. copy files from the mobile phone device to the local computer:
Adb pull Device directory local directory example: adb pull/sdcard/mm.txt D :\( copy the txt file from the root directory of the memory card to the root directory of the D disk)
7. copy files from the local computer to the mobile device
Adb push local directory mobile phone Device directory example: adb push D: \ mm.txt/sdcard
8. view the adb Command help information: adb help
9. screenshot example: adb shell screencap-p file path
10. view the database storage information of the application with the specified package name (including the stored SQL statement)
Example: adb shell dumpsys dbinfo [packagename]
11. view the memory information of the specified process or process id
Adb shell dumpsys meminfo [packagename/pid] to view the current memory of the process
Example: adb shell dumpsys meminfo com. tencent. mm
12. view the detailed information of the application with the specified package name (equivalent to the content in AndroidMainfest. xml)
Adb shell dumpsys [packagename] example: adb shell dumpsys com. tencent. mm
13. view the activity information of the current application adb shell dumpsys activity top to view the bug report:
Adb bugreport
14. list all apk Package Names installed on mobile phones
Adb shell pm list packages
System Application: adb shell pm list packages-s
Third-party applications: adb shell pm list packages-3
Use grep to filter: adb shell pm list packages | grep qq
15. Clear application Cache Information:
Adb shell pm clear [packagename]
16. Use adb to start the application page
Adb shell am start-n [package name + activity name]
Example: adb shell am start-n com. tencent. mm/. ui. splashacit.pdf
When the application is forced to stop, the application is stuck and needs to be stopped, run the following command: adb shell am force-stop <packagename> // such as adb shell am force-stop cn. androidstar. demo
17. Record wireless communication logs:
In general, there are a lot of wireless communication logs and there is no need to record them during operation, but we can still set the record through the command:
Adb shell
Logcat-B radio
18. get the device ID and serial number: adb get-product
Adb get-serialno
19. Access the database SQLite3 adb shell
Sqlite3 # cd system/sd/data // enter the specified folder in the system
# Ls // the contents of the current folder are displayed in the list
# Rm-r xxx // delete a folder named xxx and all its files
# Rm xxx // delete file xxx
# Rmdir xxx // Delete the xxx folder
20. Export device information
Adb get-serialno> Sequence No. .txt
Adb shell cat/sys/class/net/wlan0/address> macaddress .txt
Adb shell getprop ro. product. model> device type .txt
Adb shell getprop ro. build. version. release> system release .txt
Adb shell pm list packages-s> All package names of system applications. txt
Adb shell pm list packages-3> third-party application package name .txt
Adb shell wm size> screen opening rate .txt
Adb shell wm density> screen density .txt
Adb shell cat/proc/cpuinfo> cpuinformation .txt
Adb shell pm list permissions-f> permission limit .txt
Adb shell pm list users-f> User .txt
21. Restart adb reboot
There are two very useful commands:
1. Back up adb backup
[-F <file>] [-apk |-noapk] [-shared |-noshared] [-all] [-system | nosystem] [<packages...>]
Example: adb backup-f mm. AB-noapk-noshared-nosystemcom. tencent. mm the most basic command you can use is very simple.
Adb backup-all
It uses the default method to back up application and device data (excluding apk) to the current directory and save it as a file backup. AB
※This command may not be valid for every setting. If you see "adb: cannot open file" like this. /backup. AB "error. Use adb backup-all-fC: \ backup. the path C: \ can be replaced according to your preference.
Description of parameters:
-F <file>
Use this to select where the backup file is stored, such as-f/backup/mybackup. AB will store the file in the folder named backup next to the root disk (Windows Drive C), and the backup file name is mybackup. AB
-Apk |-noapk
This determines whether to include the apk in the backup or only back up the application data. We recommend that you use-apk to prevent some applications from being found in the application market. If not, the default value is-noapk.
-Shared |-noshared
This parameter is used to determine whether to back up the SD card content shared by the device. The default value is-noshare, which mainly includes music, images, and videos in the internal storage. Therefore, we recommend that you add-share
-All
This parameter is a simple expression of "all applications". The package parameter can be used to back up a separate application. If you do not back up an application, use-all to back up the entire system.
-System |-nosystem
This parameter determines whether the-all label contains system applications. The default value is-system. You can choose whether to use-nosystem based on the actual situation.
<Packages...>
If you know the name of the application installation package (for example, com. google. android. apps. plus), you can use this parameter to back up a specific application.
3. After deciding how to execute the backup, enter the command you like to test on the G700 and use the command
Adb backup-apk-all
Update common decompilation commands:
1. Check the Memory loading status of the current process:
Cat/proc/7654/maps view the current process memory ing
2. view the port number used by the current application:
Cat/proc/[pid]/net/tcp
3. view the process status information:
Cat/proc/[pid]/status can be used to obtain the package name, PID, PPID, and other important information of the current process (more practical commands)
4. view the details of a dex File
Dexdump [dex file path]
5. Use the aapt command to obtain the apk inventory file
Aapt dump xmltree [apk package] [resource file xml to be viewed]