ADB测试

=AVERAGEIF(D2:D61,"<>0")
https://github.com/alibaba/mobileperf
https://github.com/williamfzc/stagesepx
46.13953488 39
43.22222222 44
42.27272727 40

http://blog.chinaunix.net/uid-23381466-id-88482.html
https://www.cnblogs.com/MMLoveMeMM/articles/3707287.html
https://www.nowcoder.com/questionTerminal/65b32a02245643979dde0aa82c8151c3
fX,X可用任何字符
l表示向右移一位
ct'表示删除至引号前
ct'
di'
df'
vf'hc
f'l

adb -s 8AGX0SSM4 shell am start -W –n tv.danmaku.bili/tv.danmaku.bili.MainActivityV2 adb -s 8AGX0SSM4 shell "dumpsys window | grep mCurrentFocus" adb -s 8AGX0SSM4 shell am start -W -S com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity adb shell "su -c 'setprop ro.lmk.debug 1'" adb logcat | grep "lowmemorykiller.*id" adb shell "su -c 'swapoff /dev/block/zram0'" adb shell "su -c 'swapon /dev/block/zram0'"
查看手机中所有的app包名,应用pid
adb shell pm list packages adb shell ps | findstr "com.tencent.qqmusic"
启动关闭应用
adb shell am start -W –S tv.danmaku.bili/.MainActivityV2 adb shell am start -W –n tv.danmaku.bili/.MainActivityV2 adb shell am force-stop com.android.settings adb shell pm clear com.android.settings
查看当前进程包名及Activity(aapt,apktool)
adb shell "dumpsys window | grep mCurrentFocus" adb shell "dumpsys window | grep mCurrentFocus | sed 's/.*u0 //g'|sed 's/}//g'" adb shell "dumpsys window | grep mCurrentFocus | sed 's/.*u0 //g'|sed 's/}//g'|sed 's/\/.*//g'" adb shell "dumpsys window | grep mCurrentFocus | sed 's/.*u0 //g'|sed 's/}//g'|sed 's/.*\///g'" adb shell "dumpsys window w|grep \(name= | sed 's/mSurface=Surface(name=//g'|sed 's/)//g'|sed 's/ //g'|sed 's/\/@.*//g' | sed -n '/\//p'" adb shell "dumpsys window w|grep \(name= | sed 's/mSurface=Surface(name=//g'|sed 's/)//g'|sed 's/ //g'|sed 's/\/@.*//g' | sed -n '/\//p'|sed 's/\/.*//g'" adb shell "dumpsys window w|grep \(name= | sed 's/mSurface=Surface(name=//g'|sed 's/)//g'|sed 's/ //g'|sed 's/\/@.*//g' | sed -n '/\//p'|sed 's/.*\///g'"

monkey一般用法
monkey -p com.taobao.taobao --pct-touch 100 1000 monkey -p com.taobao.taobao --throttle 500 --pct-touch 100 20 全屏状态 adb shell settings put global policy_control immersive.full=* 恢复:adb shell settings put global policy_control null adb shell monkey -p com.tencent.mobileqq --pct-syskeys 0 1000
记录应用冷启动时间
adb shell logcat -b main | findstr ActivityManager: adb shell logcat -b events | findstr am_activity_launch_time adb shell logcat -b main > package.txt cat package.txt | findstr 'ActivityManager: Displayed' | sed 's/.*Displayed //g' | sed 's/: +.*ms//g'

stagesepx
adb shell screenrecord --time-limit 10 /sdcard/bilidemo.mp4 adb -s 8AGX0SSM4 pull /sdcard/bilidemo.mp4 /home/bob/lh/video/ stagesepx analyse bilidemo.mp4 bilireport.html

包名
tv.danmaku.bili/.MainActivityV2 com.sina.weibo/.SplashActivity ctrip.android.view/ctrip.business.splash.CtripSplashActivity com.youku.phone/com.youku.v2.HomePageEntry com.tencent.qqmusic/.activity.AppStarterActivity com.qq.reader/.activity.SplashActivity com.tencent.weread/.WeReadFragmentActivity com.autonavi.minimap/com.autonavi.map.activity.NewMapActivity com.gotokeep.keep/.splash.SplashActivity com.android.chrome/com.google.android.apps.chrome.Main com.wandoujia.phoenix2/com.pp.assistant.activity.PPMainActivity com.taobao.taobao/com.taobao.tao.TBMainActivity com.jingdong.app.mall/.MainFrameActivity com.tencent.mobileqq/.activity.SplashActivity

链接:https://zhuanlan.zhihu.com/p/67055544
“高速摄像机或Iphone慢动作”查看应用的启动时间 1)使用高速相机或Iphone的慢动作(240ps)录制应用的启动视频 2)使用QucikTime的帧分析功能,确定好起始帧(手指按下抬起时)和结束帧(应用完全显示) 3)根据帧数计算启动时间:=1000*帧数量/240 ThisTime:一连串启动Activity的最后一个Activity开始算起始时间 TotalTime:一连串启动Activity的第一个Activity开始算起始时间 WaitTime:总的耗时,但是包括前一个应用 Activity pause 的时间和新应用启动的时间说明:例如有的应用启动Activity的时候,会先显示一个白色的Activity,然后在显示正常Activity,这个时候TotalTime就是从第一个Activity启动作为起始时间,如果只有一个Activity则ThisTime和TotalTime相等 总结:如果只关心某个应用自身启动耗时,参考TotalTime;如果关心系统启动应用耗时,参考WaitTime;如果关心应用有界面Activity启动耗时,参考ThisTime adb脚本录屏方法(不一定有用,有的机器无该命令或–bugreport选项,且需要android API21+) 测试方法: 1)adb shell screenrecord –bugreport /sdcard/test.mp4 2)使用QuickTime分析视频即可,同方法1 备注:查看是否支持-bugreport选项使用 adb shell screencap –help

更改ubuntu18.04中pip对应的python版本 which pip which pip3.7 whereis pip sudo cp /usr/local/bin/pip /usr/local/bin/pip_back sudo rm /usr/local/bin/pip sudo ln -s /usr/local/bin/pip3.7 /usr/local/bin/pip pip -V pip install --upgrade pip

你可能感兴趣的:(ADB测试)