STF 集成 IOS 部署以及填坑

版本

  • Mac OS :mac OS Catalina 10.15.4
  • xCode :10.1
  • Node :v8.17.0

问题1

xCode 版本与 mac OS 版本兼容问题,最开始下载的是xCode 11.4.1,遇到了问题较多。并且WDA安装与配置总是有问题,真机上总是安装不成功。改成使用 xCode 10.1 正常

caught "NSInvalidArgumentException", "-[UITestingUITests internalImplementat
Showing Recent Messages :-1: WebDriverAgentLib has conflicting provisioning

问题2

安装usbmuxd和libimobiledevice报错,Your Xcode (10.1) is too outdated

brew install --HEAD usbmuxd
brew install --HEAD libimobiledevice
错误提示:

brew install --HEAD usbmuxd Error: Your Xcode (10.1) is too outdated.

解决办法:

打开文件 /usr/local/Homebrew/Library/Homebrew/extend/os/mac/diagnostic.rb, 删除检查最小版本函数这行 check_xcode_minimum_version

def fatal_build_from_source_checks
    %w[
      check_xcode_license_approved
      check_xcode_minimum_version
      check_clt_minimum_version
      check_if_xcode_needs_clt_installed
    ].freeze
    end

问题3

由于更换了xCode后,test总是不成功,

解决办法:

需要Clean Build Folder,使用快捷键

Command-Option-Shift-K to clean out the build folder

问题4

inspector的地址打开页面报错,http://localhost:8100/inspector

原因是:https://github.com/mrx1203/stf.git 中fork的stf项目,stf貌似将inspector给干掉了

暂未解决,作者原话:

As for the inspector, there is a problem when executing bootstrap.sh to configure the WDA dependency. You can ignore it.

For stf, the inspector function is not used,so just ignore it.if you really need it ,you can search for the error info to fix it.

问题5

因为xCode 10.1 没有ios 12.2版本的iOS真机调试包,需要单独下载后,复制到对应iPhoneOSDeviceSupport目录下

错误提示:

Xcode could not locate device support files. 12.2

解决办法:

git clone https://github.com/filsv/iPhoneOSDeviceSupport项目,解压其中需要对应版本真机调试包,解压到下面目录

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

问题6

mac 本地 stf 搭建好了后,http://localhost:7100 页面显示空白,前端js报错,如下

Uncaught Error: Cannot find module "!!../../../node_modules/css-loader/index.js!../../../node_modules/sass-loader/index.js!./nine-bootstrap.scss"

解决办法:

重新安装sass-loader 和 css-loader,最后一定要执行 npm link

installed sass-loader and css-loader globally
npm rebuild node-sass

npm link

问题7

stf 集成 ios的模拟器时,控制台出现报错

Setup had an error TypeError: Cannot read property 'sdk' of null

解决办法:

发现 xcrun simctl list devices -j 的返回值中,前缀部分略有不同,修改了下并解决
image

问题8

在解决问题7后,IOS模拟器识别到了,但是点击设备后黑屏

Error: connect ECONNREFUSED 127.0.0.1:6104
image

解决办法:

暂时没有解决方案

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容