当前位置:网站首页>【软件测试】常用ADB命令
【软件测试】常用ADB命令
2022-08-04 22:54:00 【代码小怡】
查看当前连接设备:
查看当前连接设备:
adb devices
如果发现多个设备:
adb -s 设备号 其他指令
举例:
adb -s devicel install xxx.apk
查看顶部Activity:
windows环境下:
adb shell dumpsys activity | findstr "mFocusedActivity"
Linux、Mac环境下:
adb shell dumpsys activity | grep "mFocusedActivity"
查看日志:
adb logcat
安装apk文件:
adb install xxx.apk
此安装方式,如果已经存在,无法安装;推荐使用覆盖安装:
adb install -r xxx.apk
比分直接RUN出来的包是test-onlu的无法安装,推荐使用**-t**
adb install -r -t xxx.apk
卸载App:
adb uninstall com.zhy.app
如果想要保留数据,则:
adb uninstall -k com.zhy.app
传递文件:
往手机SDCard传递文件:
adb push 文件名 手机端SDCard路径
例如:
adb push 帅照.jpg /sdcard/
从手机端下载文件:
adb pull /sdcard/xxx.txt
查看手机端安装的所有app包名:
adb shell pm list packages
启动Activity:
adb shell am start 包名/完整Activity路径
例如:
adb shell am start com.zhy.aaa/com.zhy.aaa.MainActivity
如果需要携带参数(携带一个Intent,Key 为name):
adb shell am start com.zhy.aaa/com.zhy.aaa.MainActivity -e name zhy
启动一个隐式的Intent:
adb shell am start -a "android.intent.action,VIEW" -d "https://www.google.com"
发送广播:
adb shell am broadcast -a "broadcastactionfilter"
-如果需要携带参数(携带一个Intent,key为name):
adb shell am broadcast -a "broadcastactionfilter" -e name zhy
启动服务:
adb shell am startservice "com.zhy.aaa/com.zhy.aaa.MyService"
屏幕截图:
可以使用screencap命令来进行手机屏幕截图;
例如:
adb shell screencap /sdcard/screen.png
录制视频:
可以使用screenrecord[options] filename命令来录制屏幕视频;
例如:
adb shell screenrecord /sdcard/demo.mp4
最后感谢每一个认真阅读我文章的人,下面这个网盘链接也是我费了几天时间整理的非常全面的,希望也能帮助到有需要的你!

这些资料,对于想转行做【软件测试】的朋友来说应该是最全面最完整的备战仓库,这个仓库也陪伴我走过了最艰难的路程,希望也能帮助到你!凡事要趁早,特别是技术行业,一定要提升技术功底。希望对大家有所帮助……
如果你不想一个人野蛮生长,找不到系统的资料,问题得不到帮助,坚持几天便放弃的感受的话,可以点击下方小卡片加入我们群,大家可以一起讨论交流,里面会有各种软件测试资料和技术交流。
敲字不易,如果此文章对你有帮助的话,点个赞收个藏来个关注,给作者一个鼓励。也方便你下次能够快速查找。
自学推荐B站视频:
零基础转行软件测试:自学完软件测试,拿到了字节的测试岗offer,堪称B站最好的视频!
边栏推荐
猜你喜欢

【字符串函数内功修炼】strlen + strstr + strtok + strerror(三)

I was rejected by the leader for a salary increase, and my anger rose by 9.5K after switching jobs. This is my mental journey

各行各业都受到重创,游戏行业却如火如荼,如何加入游戏模型师职业

SSM整合完整流程讲解

go语言的日志实现(打印日志、日志写入文件、日志切割)

xss总结

Community Sharing|Tencent Overseas Games builds game security operation capabilities based on JumpServer

亿流量大考(3):不加机器,如何抗住每天百亿级高并发流量?

good luck

【字符串函数内功修炼】strncpy + strncat + strncmp(二)
随机推荐
【游戏建模模型制作全流程】使用ZBrush制作骷髅王
CS8416国产替代DP8416 数字音频接收器
How to make a video gif?Try this video making gif artifact
从“草原牛”到“数字牛”:蒙牛的数字化转型之道
SQL Server 调用 WebService
DREAMWEAVER8 part of the problem solution
kernel问题定位手段总结
【字符串函数内功修炼】strcpy + strcat + strcmp(一)
【3D建模制作技巧分享】在zbrush中如何雕刻头发 ZBrush头发雕刻小技巧
剑指Offer | 数值的整数次方
【3D建模制作技巧分享】ZBrush如何设置笔刷快捷键
good luck
The Record of Reminding myself
I was rejected by the leader for a salary increase, and my anger rose by 9.5K after switching jobs. This is my mental journey
kernel hung_task死锁检测机制原理实现
中国的顶级黑客在国际上是一个什么样的水平?
VC bmp文件总结
历史上的今天:PHP公开发布;iPhone 4 问世;万维网之父诞生
Detailed usage of LocalDateTime
[Cultivation of internal skills of string functions] strlen + strstr + strtok + strerror (3)