appium mac环境配置安装(ios自动化)
- 官网介绍以及安装:
- JAVA安装配置
- 下载安装后设置环境变量,~/.bash_profile
- Android SDK安装配置
- 直接下载压缩包解压安装后设置环境变量,~/.bash_profile
- 或者brew cask install android-sdk,同样设置环境变量
- Node安装配置
- Nodejs安装完成之后避免npm安装包需要root权限,对nodejs目录设置权限:sudo chown -R
whoami
/usr/local (https://github.com/npm/npm/issues/5922) - 安装nrm, npm install -g nrm
- 通过nrm设置npm源为cnpm或者taobao
- Nodejs安装完成之后避免npm安装包需要root权限,对nodejs目录设置权限:sudo chown -R
- appium安装配置,GFW存在下载比较慢
- npm install -g appium
-
appium-doctor安装(
npm install -g appium-doctor
),检测出如下问题- 提示Xcode Command Line Tools are NOT installed!
- Command Line Tools:是在Xcode中的命令行工具
- 安装:xcode-select –install
- 提示Carthage was NOT found
- Carhtage介绍:Carthage用于管理Cocoa第三方框架的工具
- 安装:brew install carthage //WebDriverAgent 依赖的管理工具
- WebDriverAgent is a WebDriver server implementation for iOS that can be used to remote control iOS devices. It allows you to launch & kill applications, tap & scroll views or confirm view presence on a screen. (https://github.com/facebook/WebDriverAgent)
- 完全安装好后,检查结果如下
- 提示Xcode Command Line Tools are NOT installed!
ios8+需要使用XCUITest框架;
-
扩展包安装:
- brew install libimobiledevice —-HEAD //git submodules的依赖,真机必装
- brew install ideviceinstaller // IOS9有效,IOS无效
- npm install -g ios-deploy //IOS10,真机必装
- gem install xcpretty //可以不安装,make Xcode output more reasonable
- 真机使用XCUItest运行的配置步骤https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
- Necessary installed software,必装软件
- libimobiledevice,见上步骤
- ios-deploy,见上步骤
- code sign config,证书签名配置并打包WebDriverAgentRunner安装在设备中
- WebDriverAgent依赖下载安装步骤:
- cd ~/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
- mkdir -p Resources/WebDriverAgent.bundle
- sh ./Scripts/bootstrap.sh
- 遇到一个问题fatal: could not read Username for ‘https://github.com‘: terminal prompts’,经过排查,发现其中一个包改变了github源地址,无法下载所以报错,更新[email protected]+即可(直接升级到了1.6.5)
- 遇到一个问题Error: Cannot find module ‘eslint-config-appium’,加上参数-d即可,sh ./Scripts/bootstrap.sh -d
- WebDriverAgent编译,并启动WebDriverAgent服务http://blog.****.net/wuxuehong0306/article/details/54377957
- WebDriverAgent依赖下载安装步骤:
- Necessary installed software,必装软件