美文网首页
adb常用命令

adb常用命令

作者: xiaohan_zhang | 来源:发表于2020-05-14 15:30 被阅读0次
adb常用命令
  • 启动adb server
    adb start-server
  • 关闭adb server
    adb kill-server
  • 获取设备号
    adb devices
  • 获取系统版本号
    adb -s 设备号 shell getprop ro.build.version.release
  • 发送文件到手机
    adb push 电脑端文件路径/需要发送的文件 手机端存储的路径
  • 从手机拉取文件
    adb pull 手机端的路径/拉取文件名 电脑端存储文件路径
  • 查看手机运行日志
    adb logcat
  • 手机shell命令行
    adb shell
  • 获取app启动包名和启动名(⚠️ 手机需要先打开对应app)
    1.Mac/Linux
    adb shell dumpsys window windows | grep mFocusedApp
    2.Windows
    adb shell dumpsys window windows
    mFocusedApp这一行的内容

mFocusedApp=AppWindowToken{a05da26 token=Token{97d9981 ActivityRecord{327a168 u0 cn.cntv/.ui.activity.MainActivity t4}}}
包名:cn.cntv
启动名:.ui.activity.MainActivity

  • 安装app到手机
    adb install 路径/xx.apk
  • 卸载手机手机app
    adb uninstall 包名
  • 获取app启动时间
    adb shell am start -W 包名/启动名
    示例:adb shell am start -W com.yly.drawpic/.MainActivity
    TotalTime:app自身启动时间
    WaitTime:系统启动应用时间

相关文章

网友评论

      本文标题:adb常用命令

      本文链接:https://www.haomeiwen.com/subject/fzptohtx.html