易游网-易游模拟器

 找回密码
 立即注册
查看: 1831|回复: 0

[andriod] adb调试工具使用汇总

[复制链接]

3382

主题

3401

帖子

38

积分

超级版主

Rank: 8Rank: 8

积分
38

技术达人

发表于 2020-12-4 20:57:50 | 显示全部楼层 |阅读模式
例举所有的应用的包
adb -s 设备id shell pm list packages

获取某个app的路径
adb -s 50e4dda5 shell pm path com.uc108.mobile.gamecenter


常用adb操作
1、如何把电脑上的文件或文件夹传到模拟器里面?
adb push D:/1.avi /mnt/avi/

2、如何把模拟器里面的文件或文件夹传到电脑上?
adb pull /mnt/avi/sex.avi D:/avi/

3、安装APK
adb install d:\\qq.apk

4、卸载APK
adb uninstall 包名
比如卸载QQ:adb uninstall com.tencent.mobileqq

5、PM包命令
1)获取模拟器所有包名
adb shell pm list packages

2)获取模拟器所有包名并且包括APK路径
adb shell pm list packages -f

3)获取包名对应的APK路径
adb shell pm path packageName

4)清理应用数据
adb shell pm clear packageName

6、启动应用
adb shell am start -n 包名/Activity类名

例子:启动应用宝:
adb shell am start -n com.tencent.android.qqdownloader/com.tencent.assistant.activity.SplashActivity

指定模拟器启动动应用宝:
adb -s 127.0.0.1:5555 shell am start -n com.tencent.android.qqdownloader/com.tencent.assistant.activity.SplashActivity

7、关闭应用
adb shell am force-stop 包名

8、模拟输入
adb shell input text 字符串(不支持中文)

9、模拟按键
adb shell input keyevent 键值

10、模拟鼠标点击
adb shell input tap X Y

11、模拟鼠标滑动
adb shell input swipe X1 Y1 X2 Y2

12、截屏
adb shell screencap -p /sdcard/screencap.png

13、获取模拟器手机,顶层窗口
dumpsys activity top | grep --color=always ACTIVITY

14、设置指定应用以调试模式启动:adb shell am set-debug-app -w 包名
adb shell am set-debug-app -w --persistent 包名
adb shell am clear-debug-app

关闭ADB建立的调试通道:adb forward --remove-all
15、查看安卓应用最上层窗口
adb.exe shell dumpsys activity | findstr mFocuse


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|易游网-易游模拟器 Copyright @2015-2021 ( 浙ICP备15028007号-1 )

GMT+8, 2024-5-3 09:01 , Processed in 0.023438 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表