当前位置:网站首页>Appium 环境搭建
Appium 环境搭建
2022-06-29 06:39:00 【王大大、】
一、下载并安装appium客户端(勿装1.15.1版本,1.15.1版本很多坑)
进入appium官网http://appium.io/下载版本,将下载好的版本按照步骤进行安装


Appium-Python-Client第三方包
pip3 install Appium-Python-Client -i https://pypi.tuna.tsinghua.edu.cn/simple
二、配置jdk及Android sdk环境
2.1、jdk8下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
按照步骤进行安装jdk
2.2、Android SDK下载地址:http://dl.google.com/android/android-sdk_r23.0.2-windows.zip
2.2.1、下载SDK后解压文件,运行SDK Manager安装platform-tools
2.2.2、配置Android环境变量
1)、新增系统变量,变量名:ANDROID_HOME,变量值:Android SDK存放根目录
2)、在系统变量path中新增变量:;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;




三、appium启动Android app
android (vivo x21) desired capabilities:
{ “appPackage”: “com.lumiunited.aqarahome”, “appActivity”: “com.lumiunited.aqara.main.SplashActivity”, “noReset”: “true”, “platformVersion”: “9”, “deviceName”: “android”, “platformName”: “Android” }
四、appium 启动iOS app
4.1、iOS真机安装webdriveragent(appium自带WDA,WDA路径见配置环境中问题记录2)
1)、终端进入目录:/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/webdriveragent
2)、执行脚本
命令行终端到wda根目录下, 运行./Scripts/bootstrap.sh
3)、打开项目,配置开发者证书,WebDriverAgentRunner项目build setting修改bundle Id为唯一标识(如com.lumi.WebDriverAgentRunner),product-》test运行
4)、浏览器输入http://localhost:8100/status,可显示结果数据,例如下:
{ “value” : { “message” : “WebDriverAgent is ready to accept commands”, “state” : “success”, “os” : { “name” : “iOS”, “version” : “13.4.1”, “sdkVersion” : “13.4” }, “ios” : { “simulatorVersion” : “13.4.1”, “ip” : “10.0.100.19” }, “ready” : true, “build” : { “time” : “May 21 2020 18:36:31”, “productBundleIdentifier” : “com.facebook.WebDriverAgentRunner” } }, “sessionId” : “B9BE0798-C334-47BE-AFDF-F99D12CC036D” }
WebdriverAgent环境配置成功
5)、启动appium,配置desired capability为:
{ “bundleId”: “com.lumiunited.pre.homekit”, “automationName”: “XCUITest”, “platformVersion”: “13.4.1”, “deviceName”: “iphone”, “platformName”: “iOS”, “udid”: “2e6939b70da40972c17971831a7ed4e43087b8e9” }
五、配置环境中问题记录:
1、appium配置Android desired capabilities 启动时提示The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb(电脑已配置Android SDK环境)
解决方案:
appium-》Configurations配置Android sdk路径,重启appium可正常启动Aqara Home app
2、appium 1.15.1版本webdriver路径为:/Applications/Appium.app/Contents/Resources/app/node_modules/appium-webdriveragent
appium通用路径为:/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/webdriveragent
3、执行脚本时提示 ./Scripts/bootstrap.sh提示ERROR in ./js/app.js Module parse failed:/app.js Unexpected token错误
解决方案:1、修改Inspector下webpack.config.js文件
2、去掉babel-loader配置后的,“exclude: /node_modules/”
3、删除Inspector下node_modules文件夹
4、重新执行 “sh ./Scripts/bootstrap.sh”
4、运行时提示’assign’ property of object type may become a dangling reference; consider using ‘unsafe_unretained’
解决方案:我们在报错出双击,进入到报错代码处,将assign改为strong后再次build
边栏推荐
- How to authorize subordinates?
- 施努卡:3D视觉识别系统 3D视觉检测原理
- 软件测试面试如何正确谈论薪资?
- A hybrid model of machine learning notes time series
- Appium automation test foundation ADB common commands (II)
- Kingbasees coping with transaction rollback caused by too fast growth of table age
- ShapeShifter: Robust Physical Adversarial Attack on Faster R-CNN Object Detector
- cv2.cvtColor
- Markdown skill tree (8): code blocks
- Markdown skill tree (4): link
猜你喜欢

详解Autosar Arxml中的CANFD报文及格式

HANA数据库License的查看申请及安装

【科普资料】从科学精神到科学知识的材料

【工控老马】基于西门子S7-200PLC的跑马灯控制系统的设计方案详解
![[translation] E-Cloud. Large scale CDN using kubeedge](/img/ac/178c078589bb5bc16dbdc8f4ae9525.png)
[translation] E-Cloud. Large scale CDN using kubeedge

TREE ALV 展开Node或者点击Toolbar按钮时DUMP(CL_ALV_TREE_BASE==============CP|SET_ITEMS_FOR_COLUMN)

1032 Sharing

What you should know about databases

1032 Sharing

Vibration signal generation and processing based on MATLAB Doppler effect
随机推荐
How to view software testing training? Do you need training?
Markdown skill tree (9): tables
LSTM神经网络和普通神经网络的使用
帆船动力学仿真分析
Appium自动化测试基础 — ADB常用命令(三)
1032 Sharing
Comment choisir les fournisseurs de marques CRM dans l'industrie du vêtement?
【工控老马】基于西门子S7-200PLC的跑马灯控制系统的设计方案详解
IMX6DL4.1.15支持EIM总线(上)——实际操作,修改内容。
The table cannot be vacuumed because the cursor is open for a long time
Swin Transformer理论讲解
How to authorize subordinates?
What you should know about databases
KingbbaseES V8R6集群维护案例之---集群之间数据迁移
Es query syntax
Blue Bridge Cup - minimum frame
1032 Sharing
101. 对称二叉树(递归与迭代方法)
蓝桥杯——13届第二批试题解析
Concurrent idempotent anti shake