Prerequisites
Before you can run tests on iOS devices, you’ll need to set up Appium and the iOS-specific dependencies:-
Install Appium Server and dependencies:
-
Verify your Appium installation:
This command will check your system specifically for iOS testing requirements and highlight any issues that need to be fixed.
-
Start the Appium server:
You’ll need to keep this server running in a separate terminal window while executing your tests.
Setting Up an iOS Simulator
Testpilot works with iOS simulators managed through Xcode. Here’s how to set one up:- Install Xcode from the Mac App Store (requires macOS)
- Open Xcode and accept any license agreements
- Open the simulator by going to Xcode → Open Developer Tool → Simulator
-
Create a new simulator device:
- In Xcode, go to Window → Devices and Simulators
- Click the ”+” button to add a new simulator
- Choose a device type (iPhone 13 or newer recommended)
- Select the latest iOS version
- Give your simulator a descriptive name and click “Create”
Creating an iOS Test
Create a test file (e.g.,ios-test.pilot.yaml
) with the platform_config specifying your iOS app
bundle identifier:
Running iOS Tests
To run a test on an iOS simulator or device, use the following command. You must specify the--driver
, --os
, --runtime
, --os-version
, and --udid
flags to ensure the test runs
correctly on your iOS simulator:
You can find your device’s UDID usingTo get a list of running sims, use:
Test Platform Configuration
Theplatform_config
section of your test file is crucial for iOS testing:
- Use
url
for browser-based tests on iOS Safari - Use
ios_bundle
for native iOS app tests
iOS-Specific Considerations
When testing iOS applications, keep in mind:- Permissions: iOS will prompt for permissions (camera, microphone, etc.). Your test steps should account for these permission dialogs.
- Security Features: iOS has stricter security than Android. Your app must be properly signed and provisioned for testing.
- App Installation: For simulators, you’ll need an .app file; for physical devices, you’ll need a signed .ipa file.