1.獲取當前界面元素:adb shell dumpsys activity top
2.獲取任務列表:adb shell dumpsys activity activities
(二)App入口
1.adb logcat | grep -i displayed
2.aapt dump badging xxx.apk | grep launchable-activity
3.apkanalyzer 最新版本的SDK中才有
(三)啟動應用
1. adb shell am start -W -n com.xueqiu.android/ .view.WelcomeActivityAlias -S
(四)常用命令列表
1.adb 2.pm 3.am 4.dumpsys 5.uiautomator? 6.input
(五)Android 性能統計 dumpsys
1.獲取所有的dumpsys 子命令 dumpsys | grep -i DUMP
2.獲取當前activity adb shell dumpsys activity top?
3.獲取activity 的記錄,可以獲取到appium 依賴的原始 accivity dumpsys activity activities
4.獲取特定包基本信息 adb shell dumpsys package com.xueqiu.android
5.獲取系統通知:adb shell dumpsys notification
6.獲取內存信息:adb shell dumpsys meninfo com.android.setting
7.獲取cpu 信息 : adb shell dumpsys cpuinfo
8.獲取gpu繪制分析 :adb shell dumpsys gfxinfo com.android.settings
9.獲取短信 adb shell dumpsys activity broadcasts | grep senderName =
(六)uiautomator
1.adb shell uiautomator runtest .....
2.adb shell uiautomator dump
(七)簡單的自動化工具 input 命令
1.text <string> (Default:touchscreen)
2.keyevent [--longpress] <key code number or name> ... (Default:keyboard)
3.tap <x> <y> (Default : touchscreen)
4.swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default:touchscreen)
5.draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default:touchscreen)
6.press (Default : trackball)
7.roll <dx> <dy> <Default:trackbal>