当前位置:网站首页>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()


边栏推荐
- return;代表含义
- 声音信号处理基频检测和时频分析
- 如何使用Photoshop合成星轨照片,夜空星轨照片后期处理方法
- Sound Signal Processing Fundamental Frequency Detection and Time-Frequency Analysis
- return; represents meaning
- Vim三种模式
- 曲柄滑块机构运动分析和参数优化
- 企业员工人事管理系统(数据库课设)
- Windows taskbar icon abnormal solution
- Three aspects of Ali: How to solve the problem of MQ message loss, duplication and backlog?
猜你喜欢
随机推荐
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
Vim简介
Summary of test points about app updates in different ways
JVM: Runtime Data Area - PC Register (Program Counter)
rhcsa 第四天
滚动条样式修改
sum of special numbers
自制一款远程控制软件——VeryControl
金山打字通 官网 下载
Golang:go静态文件处理
matlab simulink 粒子群优化模糊pid控制的电机泵
Dell PowerEdge Server R450 RAID Configuration Steps
Detailed explanation of the crawler framework Scrapy
JVM:运行时数据区-PC寄存器(程序计数器)
根据指定区域内容生成图片并进行分享总结
Classwork (7) - #598. remainder operation (mod)
头歌MySQL数据库实训答案 有目录
MySQL row locks and gap locks
LeetCode240+312+394
戴尔PowerEdge服务器R450 RAID配置步骤








