Android App專項測試

https://www.jianshu.com/p/141b84f14505html

http://www.cnblogs.com/finer/p/9601140.html shell

專項app

概念ui

adb命令spa

App啓動時間code

冷啓動htm

 

啓動app命令:blog

adb shell am start -W -n package/activity

 

中止app命令:進程

adb shell am force-stop package

 

獲取運行app包名:內存

adb logcat | grep START

 

熱啓動

 

啓動app命令:

adb shell am start -W -n package/activity

 

中止app命令:

adb shell input keyevent 3

 

CPU

 

 

查看cpu的資源佔用:

Mac下:

adb shell dumpsys cpuinfo | grep packagename

 

Windows下:

adb shell dumpsys cpuinfo | findstr packagename

 

內存

 

 

獲取app進程ID:

adb shell ps | findstr pcakageName

 

查看App內存的佔用:

adb shell top -n 1 -d 0.5 | findstr pid(進程ID)

 

流量

 

 

獲取進程ID指令:

adb shell ps | grep packagename

 

查看Android 設備的網卡信息:

adb shell netcfg

查看全部網卡流量:

adb shell cat /proc/pid/net/dev

 

獲取進程ID網卡流量:

adb shell cat /proc/ pid /net/dev | findstr wlan0

 

電量

 

 

設置手機爲非充電狀態:

adb shell dumpsys battery set status 1

 

查看電量的使用狀況:

adb shell dumpsys battery |findstr level
相關文章
相關標籤/搜索