标签:user iap system 开发 滑动 如何 service number flash
ADB(Android Debug Bridge), 可以用来操作手机设备或模拟器的命令行工具, 可以从android sdk目录下面的platform-tools找到,如何使window系统,为了使用方便,可以将sdk中的adb所有目录加入环境变量中,这样就可以直接在cmd下使用adb了。
1.查看当前连接设备,并root连接手机,需要手机root才可以执行remount:
adb devices
adb root
adb remount
2.启动和关闭ADB服务:
adb kill-server
adb start-server
3.remount userdebug版本的手机时,提示没有接触验证锁定,需要先去开发者模式中打开OEM unlocking选项,然后执行如下命令:
adb root adb reboot bootloader fastboot flashing unlock //此时会提示按音量上键 fastboot reboot //也可以直接长按power重启手机 adb root adb disable-verity adb reboot adb root adb remount
4.dump activity 以及打开一些debug开关:
adb shell dumpsys activity //查看Activity所有信息 adb shell dumpsys activity activities/services/providers/broadcasts/intents/processes //查看Activity各个组件的信息
//比如需要 dump systemui的所有信息,可以输入如下命令
adb shell dumpsys activity service com.android.systemui/com.android.systemui.SystemUIService
adb shell dumpsys window -d enable DEBUG_INPUT
adb shell dumpsys activity log x on
adb shell dumpsys window -d enable a
5.录制屏幕视频
adb shell screenrecord /sdcard/screen.mp4
adb pull /sdcard/screen.mp4 ./qqq/
6.adb shell 模拟按键,滑动,点击操作,此操作对于复现问题,测试脚本非常有用
//模拟输入 abc
adb shell input text “abc”
//模拟home按键
adb shell input keyevent 3
//模拟点击(200, 200)坐标
adb shell input tap 200 200
//模拟滑动,从(100,0)滑动到(100,300)
adb shell input swipe 100 0 100 300
7.adb shell start命令
adb shell am start -n com.android.settings/com.android.settings.Settings
adb shell am startservice -n com.android.music/com.android.music.MediaPlaybackService
adb shell am broadcast -a com.smz.broadcast
8.adb install 命令
app install -r weibo.apk
-r: replace existing application
-t: allow test packages
-d: allow version code downgrade (debuggable packages only)
-p: partial application install (install-multiple only)
-g: grant all runtime permissions
9 adb pm 命令
adb shell pm list packages -e "baidu" //只列出启用的包,并且包名中含有baidu
adb shell pm list packages > 1.log
pm list permission-groups
pm list permissions [-g] [-f] [-d] [-u] [GROUP]
pm list instrumentation [-f] [TARGET-PACKAGE]
pm list features
pm list libraries
pm list users
pm path PACKAGE
pm dump PACKAGE
pm install [-lrtsfd] [-i PACKAGE] [PATH]
标签:user iap system 开发 滑动 如何 service number flash
原文地址:https://www.cnblogs.com/newthread/p/12897681.html