Code notes in work--adb command Chapter

Source: Internet
Author: User


1. Capture the Log method (BAT file)
mkdir D:\logcat
set/p miaoshu= Please describe the operation:
ADB logcat-v threadtime > D:\logcat\%miaoshu%_%date:~0,4%-%date:~5,2%-%date:~8,2%_%time:~0,2%-%time:~3,2%.txt

2. How to catch the ANR:

ADB pull Data/anr/traces.txt > D:\

3. Run Monkey Script (BAT file)

Set begintimes=1500
adb shell monkey-p com.jd.smart.fridge.launcher-p--ignore-crashes--ignore-timeouts--ignore-security-exceptions-- Ignore-native-crashes--monitor-native-crashes-v-v-v--throttle%begintimes% 100000 > D:\monkey_01.txt
Ping-n 127.0>nul
adb shell monkey-p com.jd.smart.fridge.launcher-p--ignore-crashes--ignore-timeouts--ignore-security-exceptions-- Ignore-native-crashes--monitor-native-crashes-v-v-v--throttle%begintimes% 100000 >> D:\monkey_01.txt

4. Record the video of the APK and export it to local (View.bat,screen.bat)

:: Android Command
adb shell screencap-p/sdcard/screen.png #-p is saved in PNG format
@ping-N 5 127.1 >nul 2>nul
:: Change the directory of the current directory to the batch itself
cd/d "%~dp0"
:: Gets the current time
Set y=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
:: Creating a Directory
MD%y%
:: Export the image to
ADB pull/sdcard/screen.png%y%
:: Delete the image cut from the phone
ADB Shell Rm-r/sdcard/screen.png

:: Du recorder screen command
set/p t= Please enter time (seconds): 5
adb shell Screenrecord--time-limit%t%/sdcard/view.mp4
@ping-N 5 127.1 >nul 2>nul
:: Change the directory of the current directory to the batch itself
cd/d "%~dp0"
:: Gets the current time
Set y=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
:: New Directory
MD%y%
:: Export the video to
ADB pull/sdcard/view.mp4%y%
:: Delete videos recorded on your phone
ADB Shell Rm-r/sdcard/view.mp4

5.ADB command gets CPU, memory pss

Cpu:

ADB shell top-m 5 > D:/cpu.txt

Pss:

Set Process=com.jd.smart.fridge.launcher

adb shell Dumpsys meminfo%process% | Findstr "Pss"

: M

adb shell Dumpsys meminfo%process% | Findstr "Total" >> d:/pss.txt

Ping-n 5 127.0.0.1>nul

Goto m

Code notes in work--adb command Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.