Install Xcode command-line tools. You can download the command-line tools compatible with your Xcode version from the Apple Developer website here: Download.
Alternatively, you can run the following commands in this order in the Terminal:
Download and install Node.js from the Node.js website: Node.js Downloads.
Make sure you install Node.js into a location where you have full Read/Write permissions.
Install Appium with the following commands in the Terminal:
For Katalon Studio 9.1.0 onwards, install the latest Appium version:
npm install -g appium
For Katalon Studio before 9.1.0, install Appium 1.12.1+:
npm install -g appium@version
Note:
If you are using emulators other than Xcode simulators, some emulators come with Appium installed. If you want to run an application on an emulator, check your emulator settings before installing Appium.
Install Homebrew. Homebrew is a package manager that makes it easy to install extra dependencies. To install Homebrew, follow the instructions on the Homebrew website: Homebrew.
After installing Homebrew, you can now install the following dependencies in the Terminal:
For 9.1.0 onwards:
Install Appium XCUITest driver version 4.32.24 or newer:
appium driver install xcuitest
Install libimobiledevice with the following command:
brew install libimobiledevice
For versions before 9.1.0:
For Appium versions older than 1.20.0, you need to install Carthage. You can learn more about Carthage in this Github project: Carthage. To install Carthage via Homebrew, copy and paste the following command:
brew install carthage
ios-deploy version 1.9.4 or newer. You can learn more about ios-deploy in this Github project: ios-deploy. To install ios-deploy, run the following command:
brew install ios-deploy
Install libimobiledevice version 1.2.0 or newer with the following commands in the given order:
For Appium versions older than 1.15.0, you also need to install ios-webkit-debug-proxy. You can learn more about ios-webkit-debug-proxy in this Github project: ios-webkit-debug-proxy. To install ios-webkit-debug-proxy, run the following command:
You have enrolled in the Apple Developer Program. To learn more about the Apple Developer Program enrollment, refer to this Apple document: Enrollment.
Register your device for development with Xcode in Apple Developer. To learn about registering your device in Apple Developer, refer to this Apple document: Register a single device in Apple Developer.
In Xcode > Preferences > Account, click Add (+) to enter your Apple Developer Account ID and password.
Connect your iOS devices to your computer via a USB cable. Confirm to accept or trust the phone.
To enable UI Automation on the iOS device, navigate to Settings > Developer. In the UI Automation section, turn on Enable UI Automation.
If you want to execute mobile browser tests (Safari on iOS), you will need to enable the following settings in Settings > Safari > Advanced:
The WebDriverAgent is a WebDriver server used to control iOS devices remotely. For detailed instruction on WebDriverAgent installation, refer to Install WebDriverAgent for iOS devices.
Open the project file with Xcode. For example, to open Coffee Timer.xcodeproj, go to your project folder > App > Your-First-iOS-App > Coffee Timer. Double-click the Coffee Timer.xcodeproj file.
After opening the project in Xcode, select a registered iOS device to launch the apps.
In the General tab, set deployment iOS version and select device type in the Deployment Info section.
Switch to the Signing & Capabilities tab, check the Automatically manage signing box, then choose the team that has your device registered in the Apple Developer Portal.
By choosing the Automatically manage signing box, Xcode manages code signing assets for you. To learn more about automatic signing, you can refer to this Apple document: Automatic signing.
To archive the .ipa file, click Product > Archive. If the archive builds successfully, it appears in the Archives organizer.
Note:
You can't create an archive if you set the run destination to a simulator.
Export your app using an ad hoc or development provisioning profile
When you export the app, Xcode re-signs the app using the code signing assets that you choose. To learn more about the distribution method, you can refer to this Apple document: Distribution method.
To open the Archives organizer, choose Window > Organizer and click Archives.
Select the archive you want to export, then click Distribute App and follow the instructions to get the .ipa file. Here, we choose a development provisioning profile to export the Coffee Timer.ipa file.