当前位置:网站首页>app 自动化 打开app (二)
app 自动化 打开app (二)
2022-08-01 07:09:00 【will_net】
打开模拟器,模拟器上安装一个apk,打开app ,然后退出app
查看appPackage、appActivity
#第一种方式,打开最近活跃的
adb shell dumpsys activity recents |find "intent={"
#根据apk 查找
aapt dump badging D:\Documents\WXWork\1688851374893748\Cache\File\2022-01\xxx.apk
打开 appium server gui 点击starserver
链接
创建一个py 文件
# 导包
import time
from appium import webdriver
# 准备自动化配置信息
desired_caps = {
# 移动设备平台 Android / IOS
'platformName' : 'Android' ,
# 平台 OS-- 安卓版本号 , 写整数位即可
'plathformVersion' : '7' ,
# 设备的名称 -- 值可以随便写
'deviceName' : 'meizu_882QAEU99J9HU' ,
# 提供被测 app 的信息 - 包名, 入口信息 :
# 1. 打开被测 app ,
# 2 . 命令行输入以下信息
# adb shell dumpsys activity recents | findstr intent={
'appPackage' : 'com.acadsoc.tmappl' ,
'appActivity' : 'com.acadsoc.apps.common.activity.MyFlutterActivity' ,
# 确保自动化之后不重置 app
'noReset' : True,
# 设置 session 的超时时间, 单位秒, 默认 60s
'newCommandTimeout' : 6000,
# 设置底层测试驱动 -1.15 默认使用的底层驱动就是 UiAutomator2
'automationName' : 'UiAutomator2' , # 或者 UiAutomator1
# 'skipServerInstallation' : True# 跳过 UI2 的安装, 如果第一次运行程序, 不要添加该配置
}
# IP-appium-server 所在机器的网络 ip , port- 监听的端口号, path 固定 /wd/hub
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub' , desired_caps)
driver.implicitly_wait(10) # 稳定元素
driver.quit()
边栏推荐
- JVM: Runtime Data Area - PC Register (Program Counter)
- JVM:运行时数据区-PC寄存器(程序计数器)
- 仿牛客网讨论社区项目—项目总结及项目常见面试题
- ORACLE modify another user package (package)
- Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
- LeetCode 0150. Reverse Polish Expression Evaluation
- Golang: go to connect and use mysql
- Vim简介
- LeetCode Question of the Day (309. Best Time to Buy and Sell Stock with Cooldown)
- 爬虫基本原理介绍、实现以及问题解决
猜你喜欢
图片无损压缩软件哪个好用:试试完全免费的JPG-C 图片批量修整压缩减肥工具吧 | 最新jpg批量修整工具下载
MVVM项目开发(商品管理系统一)
NIO programming
Golang: go static file processing
Electromagnetic compatibility introductory tutorial (6) test project
从购买服务器到网站搭建成功保姆级教程~超详细
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
声音信号处理基频检测和时频分析
matlab wind speed model wavelet filtering
The log causes these pits in the thread block, you have to prevent
随机推荐
mysql中添加字段的相关问题
【视觉SLAM十四讲】第一章理论详解
Golang: go open web service
Golang: go static file processing
MySQL row locks and gap locks
电磁兼容简明教程(6)测试项目
【南瓜书ML】(task4)神经网络中的数学推导(更新ing)
Golang: go to connect and use mysql
「面经分享」西北大学 | 字节 生活服务 | 一面二面三面 HR 面
第02章 MySQL的数据目录【1.MySQL架构篇】【MySQL高级】
Offer刷题——1
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
JS的运行原理
JVM:运行时数据区-PC寄存器(程序计数器)
NIO编程
LeetCode 0149. 直线上最多的点数
Golang: go get url and form attribute value
Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download
小程序通过云函数操作数据库【使用get取数据库】
Data organization -- singly linked list of the linear table