python+appnium【第二章-adb命令的使用】

时间:2021-09-02 21:37:18   收藏:0   阅读:27
adb devices
adb install 应用程序.apk包的地址  

adb install D:\apk\jisuanqi.apk 
1.先打开apk
2.windos输入 adb shell dumpsys windows | findstr mCurrentFocus
3.Mac 输入 adb shell dumpsys windos | grep mCurrentFocus
4.mCurrentFocus=Window{abd2ea8u0 com.android.calculator2/com.android.calculator2.Calculator}
5.com.android.calculator2 为主包名
6.com.android.calculator2/com.android.calculator2.Calculator 活动包名

技术分享图片
adb uninstall apk 主包名

adb uninstall com.android.calculator2

 

adb shell

 

adb nodaemon server

Netstat -ano | findstr “5037
首先我们查找一下需要上传的终端路径

比如我们上传到moveis文件夹

那我们去查找moveis

Adb shell find -name Movies

技术分享图片技术分享图片


然后上传我们一个txt文件试一下

adb push 本地文件路径  app的存放路径

adb  push D:\apk\baby.txt /data/media/0/Movies

 

 

技术分享图片

 

下载app内的文件,比如日志什么的,把路径对换一下,还可以重新定义文件名称

adb pull 手机文件路径  本机地址路径\文件名

adb pull /data/media/0/Movies/baby.txt D:\apk\babys.txt

 

技术分享图片

 

adb shell am start -n 活动包名

adb shell am start -n com.android.documentsui/com.android.documentsui.files.FilesActivity
adb shell pm clear 包名
adb shell pm clear com.android.documentsui
adb shell ps ef | grep 包名

1. windows : adb shell "ps -ef | grep com.android.documentsui"

2. Mac : adb shell ps -ef | grep com.android.documentsui
adb shell dumpsys meminfo 包名

adb shell dumpsys meminfo com.android.documentsui
adb shell "ps |grep com.android.documentsui"

然后 adb shell kill 端口号

adb shell kill 4181

技术分享图片

Android KEYCODE键值对大全 : https://blog.csdn.net/midux/article/details/80064054

操作计算机实现加法运算

1+8=9

adb shell input keyevent KEYCODE_1

adb shell input keyevent KEYCODE_PLUS

adb shell input keyevent KEYCODE_8

adb shell input keyevent KEYCODE_EQUALS

 

后续会继续更新,敬请关注

 

 

然后上传我们一个txt文件试一下

adb push 本地文件路径  app的存放路径

adb  push D:\apk\baby.txt /data/media/0/Movies

原文:https://www.cnblogs.com/yushengaqingzhijiao/p/15219961.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!