Introduction
Appium Setup
RequirementsInstall AppiumSetting Up AndroidSetting Up iOSSetting Up An EmulatorSetting Up WindowsCompiling Your App (Native Apps)Compiling Your App (Hybrid Apps)Setup A Code Editor
MoQuality Tutorials
MoQuality Dashboard
Integrations
Common Issues

Setting Up iOS

To create a test for an iOS app, you will need an iOS device with the app installed on it connected to your Mac via USB. CodeLab can be used with native apps on any iOS device. You will need to configure your dependencies required by Appium.

Quick Setup

Paste this script in your terminal prompt

sh -c "$(curl -fsSL https://raw.githubusercontent.com/moquality/devcenter/master/install.sh)" "ios"

After the quick setup, you might still have to set up WebDriverAgent and your Apple Developer Portal. See below.

Manual Setup

If you want to setup for iOS, you need to install libimobiledevice to do "certain things" [1].

brew install libimobiledevice --HEAD

There is also a dependency, made necessary by Facebook's WebDriverAgent, for the Carthage dependency manager. If you do not have Carthage on your system, it can also be installed with Homebrew

brew install carthage

iOS 10 needs ios-deploy to interact with the device

npm install -g ios-deploy

Apple Developer Team ID

You will need your developer team id to continue. To get your team id

  1. Go to developer.apple.com and login.

  2. Click on "Membership".

  3. Your team id is under "Team ID".

Setting up WebDriverAgent

In some cases, initialization for iOS will not be enough. This usually has to do with code signing and the configuration of the project to be able to be run on the real device under test. Often this happens when the development account being used is a "Free" one, in which case it is not possible to create a wildcard provisioning profile, and will often not create one for the default application bundle.

To solve this problem open Appium's WebDriverAgent project with

sh -c "$(curl -fsSL https://raw.githubusercontent.com/moquality/devcenter/master/wda.sh)"

Find the WebDriverAgent Runner scheme (find under Product > Scheme). This error will manifest as something like an error that Xcode failed to create a provisioning profile:

WebDriverAgent

In this case, open WebDriverAgent.xcodeproj in Xcode. For both the WebDriverAgentLib and WebDriverAgentRunner targets, select "Automatically manage signing" in the "General" tab, and then select your Development Team. This should also auto-select Signing Certificate. The outcome should look as shown below:

WebDriverAgent Target

Xcode may fail to create a provisioning profile for the WebDriverAgentRunner target. If this happens, you will have to manually change the bundle id of the target by going into the "Build Settings" tab and changing the "Product Bundle Identifier" from com.facebook.WebDriverAgentRunner to something <teamId>.com.facebook.WebDriverAgentRunner.

Setting up Apple Developer Portal

You will also need to ensure that the Wildcard Identifier is set up in your Apple Developer Portal.

  1. Go to developer.apple.com and login.

  2. Go to "Certificates, Identifiers & Profiles".

  3. Under "Identifiers", find "App Ids". Ensure that there is an entry with the name XC Wildcard and ID *. If not create a wildcard entry with the + button.

You will also need to ensure that the device you are using to do testing is registered in your Apple Developer Portal.

  1. Go to developer.apple.com and login.

  2. Go to "Certificates, Identifiers & Profiles".

  3. Under "Devices", ensure that you can see your device. If not, register your device here. You can find your device's unique identifier with ideviceinfo -s on your terminal.