Appium has support for real device testing.
To get started on a real device, you will need the following:
- An Apple Developer ID and a valid Developer Account with a configured distribution certificate and provisioning profile.
- An iPad or iPhone. Make sure this has been set up for development in Xcode. See this article for more information.
- A signed
.ipa
file of your app, or the source code to build one. - A Mac with Xcode and the Xcode Command Line Developer Tools.
A valid iOS Development Distribution Certificate and Provisioning Profile are necessary to test on a real device. Your app will also need to be signed. You can find information about this in the Apple documentation.
Appium will attempt to install your app using Fruitstrap, but it is often easier to pre-install your app using Xcode to ensure there are no problems (see the iOS deploy doc for more information).
Once your device and app are configured, you can run tests on that device by
passing the -U
or --udid
flag to the server or the udid
desired capability,
and the bundle ID (if the app is installed on the device) or the path to the
.ipa
or .apk
file via the --app
flag or the app
desired capability.
For example, if you are prelaunching your app and wish for Appium to force use a specific UDID, then you may use the below command:
appium -U <udid> --app <path or bundle>
This will start Appium and have Appium use the device to test the app.
Refer to the Appium server arguments page for more detail on the arguments that you can use.
You can launch the app on a device by including the following desired capabilities in your tests:
app
udid
Refer to the Appium server capabilities page for more detail on the capabilities that you can use.
- Make sure UDID is correct by checking it in Xcode Organizer or iTunes. It is a long string (20+ chars).
- Make sure that you can run your tests against the Simulator.
- Double check that you can invoke your automation from Instruments.
- Make sure Instruments is not already running.
- Make sure UI Automation is enabled on your device. Settings -> Developer -> Enable UI Automation
Hooray! There's nothing extra to know about testing real Android devices: it works exactly the same as testing on emulators. Make sure that your device can connect to ADB and has Developer Mode enabled. For testing Chrome on a real device, you're responsible for ensuring that Chrome of an appropriate version is installed.
Also, you'll want to make sure that "Verify Apps" in settings is disabled/unchecked, otherwise it can prevent some of Appium's helper apps from launching and doing their job correctly.