Article directory
Mac environment construction
-
macOS system computer: 12.6.2
-
Xcode:14.0.1(
xcodebuild -version
) -
appium Desktop: 1.21.0 ( download link )
Appium Desktop 1.22.0 , starting from this version, Appium separates the Server and Inspect tools, which need to be downloaded separately. -
Python:3.9
-
PyCharm
-
check:
npm -v
,node -v
-
cnpm:
npm install -g cnpm --registry=https://registry.npm.taobao.org
-
ios-deploy dependent library:
cnpm install -g ios-deploy
-
brew:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
-
Install libimobiledevice, carthage:
brew install libimobiledevice
brew install carthage
Configure Xcode to generate WDA
-
About the choice of WebDriverAgent
appium-webdriveragent
After installing Appium (or Appium Server GUI), a directory exists under the installation path- Or download from github. For example, I tried appium/WebDriverAgent and selected the latest WebDriverAgent-4.10.23 at this time , and click to download directly: Source code(tar.gz) . Then replace the path under
appium-webdriveragent
path:
# 如果安装的是新的 Appium Server GUI /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent
# 如果安装的是 Appium /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent
-
Enter
appium-webdriveragent
the directory and double-clickWebDriverAgent.xcodeproj
to open the project configuration -
Add a developer account
Xcode->Preferences->Accounts, for personal use, the account needs to be purchased, and the general company will provide the account.
-
select emulator
On the top bar of Xcode, click WebDriverAgentRunner to select, as shown in the picture in the next step, I chose iPhone12, and the iOS version is 14.3.
-
configuration
WebDriverAgentLib
-
configuration
WebDriverAgentRunner
Need to change the Bundle Identifier, the original default is to
com.facebook.WebDriverAgentRunner
add some random characters at the end to make it unique
-
WebDriverAgentRunner
Select the emulator (or real device) that will runWebDriverAgent: WebDriverAgentRunner > iPhone12
-
Shortcut key
command + u
Run and test- Xcode prompts Succeeded to indicate success
- After the emulator is opened, a white
WebDriverAgent
application will be generated on the interface-
common problem
brew install failed
Installation failed due to network problems, solution: command:/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
( Solve reference links that cannot be installed )
If it is not a network problem, brew install libimobiledevice
the installation fails, promptingError: command failed with exit 128: git
Try reinstalling brew the most primitive way:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Also see a method:brew install --HEAD libimobiledevice