最新macOS 11.4+Xcode 12.5+iOS 14.6 编译安装WebDriverAgent填坑记
发布时间:2023-04-06 11:19:05 所属栏目:教程 来源:
导读:最近要使用腾讯的GAutomator2来进行iOS端的unity游戏UI自动化测试,于是在配置环境阶段需要将WebDriverAgent编译安装到iOS设备上。
我有随时更新系统的习惯,Mac系统不能降级,iPhone系统不能降级。这整个的过程真
我有随时更新系统的习惯,Mac系统不能降级,iPhone系统不能降级。这整个的过程真
|
最近要使用腾讯的GAutomator2来进行iOS端的unity游戏UI自动化测试,于是在配置环境阶段需要将WebDriverAgent编译安装到iOS设备上。 我有随时更新系统的习惯,Mac系统不能降级,iPhone系统不能降级。这整个的过程真是一个坑接着一个坑,接下来记录下自己填坑的过程吧。 我的Mac系统是现在最新的: macOS Big Sur 版本:11.4 Xcode Version 12.5 (12E262) iPhone 系统版本:14.6 这使其成为用于应用程序端到端测试或通用设备自动化的理想工具。它通过调用Apple的API来直接在设备上执行命令来工作。 编译WDA 1、申请苹果开发者证书,部署IOS项目平台需要开发者证书,现在可以通过个人Apple Id登录即可 登录方式为:Xcode -> Preferences -> Accounts -> Manage Certificates -> 左下角+号 -> ios development 2、使用xcode打开:WebDriverAgent.xcodproj路径 3、选择WebDriverAgentLib和WebDriverAgentRuner的Team字段,进入Singing&Capabilities选项,修改Team字段为刚才自己设置的证书 4、设置好账号后还会报出一个错误 大概意思是这个项目的app ID冲突了,随意修改成一个不重复的id即可,修改位置: 5、选择Product -> Schema -> WebDriverAgentRunner 6、选择Product -> Destination -> 连接的真机名: 7、开始编译: 如果一切正常的话,那么就会Build Success。然后进行下面第8步: 8、运行运行Product -> Test,安装成功后手机上会出现一个无图标的WebDriverAgent应用,启动之 后,马上又返回到桌面,这是很正常的。 遇到的错误 错误1:提示build Failed,报错信息为:semantic issue:Messaging unqualified id,可以参考以下解决方案: 解决方法: 找到如下文件: /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettins.xcconfig 将 WARNING_CFLAGS = $(inherited) -Weverything -Wno-objc-missing-property-synthesis -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-gnu-statement-expression -Wno-language-extension-token -Wno-overriding-method-mismatch -Wno-missing-variable-declarations -Rno-module-build -Wno-auto-import -Wno-objc-interface-ivars -Wno-documentation-unkNown-command -Wno-reserved-id-macro -Wno-unused-parameter -Wno-gnu-conditional-omitted-operand -Wno-explicit-ownership-type -Wno-date-time -Wno-cast-align -Wno-cstring-format-directive -Wno-double-promotion -Wno-partial-availability 修改为: WARNING_CFLAGS = $(inherited) -Weverything -Wno-objc-missing-property-synthesis -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-gnu-statement-expression -Wno-language-extension-token -Wno-overriding-method-mismatch -Wno-missing-variable-declarations -Rno-module-build -Wno-auto-import -Wno-objc-interface-ivars -Wno-documentation-unkNown-command -Wno-reserved-id-macro -Wno-unused-parameter -Wno-gnu-conditional-omitted-operand -Wno-explicit-ownership-type -Wno-date-time -Wno-cast-align -Wno-cstring-format-directive -Wno-double-promotion -Wno-partial-availability -Wno-objc-messaging-id 错误2:编译报错Building for iOS, but the linked and embedded framework 'RoutingHTTPServer.framework' was built for iOS + iOS Simulator. 解决方法: 将 BuildSettings ->Build Options->Validate Workspace 设置为 Yes。它仍然会显示警告,但会构建项目。 错误3:'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained' 解决方法: 报错出双击,进入到报错代码处,将assign改为strong后再次build 错误4:implementing deprecated method 这个错误是使用了Object-C垃圾回收器不支持的方法 Objective-C garbage collection is no longer supported. 当时查到一个帖子,说了造成此错误的原因,但是没有说解决方法,由于不是开发者,说得其他的方法我也看不懂,我自己查了好久也没有找到解决方式,已经打算放弃了,后来在同事的帮助下,又继续找原因。总算功夫苦心人,我在苹果开发者文档(文末参考链接3)中找到了解决方法。 (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
