当前位置:网站首页>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()
边栏推荐
- 【ASWC Arxml结构分解】-7-Explicit(显式)和Implicit(隐式) Sender-Receiver communication描述差异
- Vim扩展内容
- 滚动条样式修改
- Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
- LeetCode240+312+394
- return; represents meaning
- I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.
- Dart 异常详解
- Golang: go static file processing
- Golang:go静态文件处理
猜你喜欢
Vim简介
Information system project managers must recite the work of the core test site (56) Configuration Control Board (CCB)
Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast
配置我的kitty
仿牛客网项目总结
NIO编程
Dell PowerEdge Server R450 RAID Configuration Steps
first unique character in characters
Offer brush questions - 1
小程序通过云函数操作数据库【使用get取数据库】
随机推荐
表的创建、修改与删除
Dbeaver connect the MySQL database and error Connection refusedconnect processing
支付宝如何生成及配置公钥证书
零代码网站开发利器:WordPress
Dart exception details
轻量级的VsCode为何越用越大?为什么吃了我C盘10G?如何无痛清理VsCode缓存?手把手教你为C盘瘦身
Does flinkcdc have any solution for mysql's date field type conversion?
奇葩问题 npm install 报错 gyp ERR
特殊的日子,值得纪念
Self-made a remote control software - VeryControl
【南瓜书ML】(task4)神经网络中的数学推导(更新ing)
我的创作纪念日
CSP-S2019兴奋不已
LeetCode Question of the Day (309. Best Time to Buy and Sell Stock with Cooldown)
How to generate and configure public key certificate in Alipay
Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download
Create, modify and delete tables
响应式织梦模板园林花卉类网站
【一句话攻略】彻底理解JS中的回调(Callback)函数
Golang: go to connect and use mysql