当前位置:网站首页>ADB regular use of work notes
ADB regular use of work notes
2022-06-28 21:52:00 【Matsuqin software test】
** One 、ADB Common commands **
##### 1.adb devices , Get device list and device status
adopt IP Connect to your phone adb connect ip
adb disconnect < The equipment IP Address >:5555 You can disconnect
If there are multiple devices , use adb devices To view the , And then through adb -s +IP Address ( Cannot occupy the same port )
##### 2.`adb get-state` , Get the status of the device
##### 3.`adb instal`l Package name , install
##### 4.`adb uninstall` Package name , uninstall
##### 5.`adb shell pm list package -s`: List system applications -f: List package name and apk Name corresponds to the storage location
##### 6.`adb shell pm list package -3` View third-party installation packages
##### 7.`adb shell dumpsys window | findstr mCurrentFocus` Get the currently open APP Package name ( The first one is the package name , The slash is followed by the currently active acivity)
##### 8.`adb shell monkey -p xxxxxx --throttle 3000 --ignore-crashes --ignore-security-exceptions --ignore-native-crashes --kill-process-after-error --pct-syskeys 30 --pct-nav 40 --pct-majornav 30 -v 5000000 >sdcard/monkey.log` Jimi desktop monkey Stability test
##### 9.`adb shell pm clear Package name ` Apply cache cleanup
##### **Monkey command Introduction to basic parameters **
1. -p , This command specifies the package , If not specified, execute... In the whole system
2. -v , The level of detail used for the feedback log , Can be specified 3 individual -v
3. -s , Used to specify a pseudo-random number generator seed value
4. --throttle , Used to specify the operation interval delay of user events , In milliseconds
5. --ignore-timeouts , Ignore timeout errors
6. --ignore-crashes , Ignore crash
7. --ignore-security-exceptions Ignore license errors
8. --monitor-native-crashes, Local code used to specify whether to monitor and report application crashes
9. --pct-touch , Touch event
10. Specify the log storage directory :adb shell monkey -p Package name -v -v -v 200>D:AAlog.txt
monkeyBUG The submission log contains :/data # ls -l , Under the adb,anr,app,tombstones, Any one Must be submitted bug.
##### 9.`adb shell screencap -p /sdcard/01.png` Save the device screenshot to sdcard, Name it 01, Format to PNG
##### 10.`adb pull /sdcard/01.png d://tu` Put the equipment sdcard The next path 01.png file PULL To the computer D disc tu Under the table of contents ( A copy of a document )
`adb push d://zy/01.png sdcard/` Turn on the computer D disc zy Under the document 01.png Copy files to device sdcard Under the table of contents
##### 11.`adb shell screenrecord --size 1280x720 --time-limit 60 --bit-rate 6000000 /sdcard/demo.mp4` The recording resolution is 1280x720, Time is 60s, Set the bit rate as 6Mbps, Save path as /sdcard/, Name it demo. The format is mp4
#### ** Two 、 Common commands for serial port connection equipment **
##### 1.shell New session : Set the name 、 Choice of agreement SERIAL,, Select serial port , The port number is COM4, The baud frequency is 11520, Data bits 8, Stop bit 1, Parity check has no , Flow control none
xshell New session : Set the name 、 Choice of agreement SERIAL,, Select serial port , The port number is COM4, The baud frequency is 11520, Data bits 8, Stop bit 1, Parity check has no , Flow control none
`echo 0 > /proc/sys/kernel/printk` Stop serial port printing to avoid disturbing the input process
![]()
##### 2. Device acquisition root jurisdiction
Step 1: download the corresponding recover Put in bags U disc
The second step is to use the command `reboot recover` Get into recover Pattern
The third step is to use `busybox blkid` Command view U Disk mount path
Step 4 mount U disc `busybox mount /dev/block/sda4/sdcard` mount by Linux Issue the mount command , The purple part is U Disk path ( The actual path obtained in step 3 shall prevail )
Step 5 go to U Directory of disk scripts : `cd /sdcard/848root`, If the script ignores this step in the root directory
Step six U Disk script : `busybox sh ./install.sh`, Wait for the script execution to complete and check the serial port printing
Step 7 input `su`( or `gmsu`) Command test whether the brush in succeeds
##### 3.xshell Filtering logs
The first step is to set up xshell logging
Step 2 enter... In the conversation table :`logcat`, Let it stop printing at the corresponding time
Step 3 copy xshell The saved log file
##### 4.U Disk copy log
The first step is to ensure that U Disk mounted
The second step is to input :`cp -r /data/tombstones/ /mnt/sdcard` notes :cp -r Force copying ,/data.../ Device log path ,/mnt/sdcard/ by U Disk path
##### 5. The device has reached the root jurisdiction
Input su/gmsu,adb shell You can also use
##### 6. Check the process ,kill process
`ps -ef |grep tv` List the TV The process of
`kill pid` kill process
##### 7. solve Windows System adb shell Chinese display garbled
Android Is used in UTF-8 character , and CMD The default character set is ANSI, In Chinese, it means GBK, The code page is 936.
The method to query the current code page is in CMD Input directly “chcp” command , And will return “ The active code page :936” word .
Find out why , The solution is .
Just use UTF-8 Format code page 65001 Just OK 了 , The order is as follows :chcp 65001
however , It still doesn't display correctly in the window UTF-8 character .
Modify window properties , Change the font Right click on the command line title bar , choice " attribute "->" typeface ", Change the font to True Type typeface "LucidaConsole", Then click OK to apply the properties to the current window .
The above operation can not completely solve the problem , Because the displayed content may not be complete . You can minimize , Then maximize the command line window , The contents of the file will be displayed completely
##### **8. Check the equipment number **
`logcat | grep -i netrequest`
Search for PID,
1. ##### ** Precautions for burying points **
边栏推荐
- Proficient in data analysis, double the income? What is the strongest competitiveness
- Safety innovation practice | Haitai Fangyuan was invited to participate in the technical exchange Seminar on "network information innovation and value co creation in the digital age"
- Bitbucket 使用 SSH 拉取仓库失败的问题
- How to analyze the relationship between enterprise digital transformation and data asset management?
- How to analyze the relationship between enterprise digital transformation and data asset management?
- An artifact extracted from a well-known software and paid by a group of people
- Application of the purple book p113map of ananagrams (uva156)
- 17 `bs对象.节点名h3.parent` parents 获取父节点 祖先节点
- Bitbucket failed to pull the warehouse Using SSH
- LeetCode116. Populate the next right node pointer for each node
猜你喜欢

Alist+raidrive gives the computer a complete 8billion GB hard disk drive

接口测试流程

How to analyze the relationship between enterprise digital transformation and data asset management?

Binomial distribution (a discrete distribution)

User network model and QoE

Live broadcast preview | can SQL also play industrial machine learning? Mlops meetup V3 takes you to the bottom!

E-commerce is popular, how to improve the store conversion rate?

什么是接口?什么是接口测试?

How to analyze the relationship between enterprise digital transformation and data asset management?

PHP login problem
随机推荐
直播预告|SQL也能玩转工业级机器学习?MLOps meetup V3带你一探究竟!
接口测试流程
Binomial distribution (a discrete distribution)
To be a cross-border e-commerce, you must learn to use PRA software, free your hands and improve efficiency!
LeetCode560. 和为K的子数组
LeetCode1114. 按序打印
Deep interpretation of WiFi security vulnerability krack
Application of Andy s first dictionary (uva10815) Purple Book p112set
Study on bifunctional crosslinker lumiprobe sulfoacyanine 7 dicarboxylic acid
【筆記:模擬MOS集成電路】帶隙基准(基本原理+電流模+電壓模電路詳解)
How do independent site sellers efficiently manage complex Facebook pages?
LeetCode121. 买卖股票的最佳时机
Openfire 3.8.2 cluster configuration
Constructing the three-dimensional anti penetration of the actual combat defense system
QJsonObject的使用示例
Sword finger offer:[day 1 stack and queue (simple)] --- > stack containing min function
LeetCode121. The best time to buy and sell stocks
LeetCode560. Subarray with and K
Workplace tips | understanding the advantages of the position "knowing people"
华为云的AI深潜之旅