Autoplay



Transcripted Summary

Before we prepare our real iOS device for Appium tests, we should know the following things:

  • Appium communicates with a real device via appium-ios-device

  • The XCUITest driver installs a helper application called the WebDriverAgent-Runner onto the device and handles the application under test via it.

  • The code signing and the provisioning application for development and testing can make this a bit of a headache. Sometimes signing and provisioning applications on a real device takes time, and you will face different issues.

  • The device should be available to Xcode to be able to run the runner or the application on the physical device

  • Please make sure that the device under test can connect to the Xcode without any issues

  • You could confirm it with the Devices and Simulators Xcode dialog from the Xcode IDE

  • The documentation on appium-xcuitest-driver is also helpful to resolve dependencies if you are facing any weird problems with the installation or when running


Now, let's prepare our real iOS device for Appium tests.

As we mentioned, you should have an Apple developer account to be able to download the certificates to our Xcode and to be able to install the application on real devices.

So, let's go to Xcode and check how we can download those certificates and sign the real application to be able to download on the real device.

I already opened the application that I am planning to install on the iOS real device or physical device.

This is a to-do list - this is the application that we will use in our test and you can click on the todoList application and go to the "Signing & Capabilities" section.



Under Signing, you can find "Automatically manage signing", or here you can find the bundle ID or Identifier, Provisioning Profile, and Signing Certificate.

Here you should add the Apple Development, or you should add the certificates that you have for Apple developer, and also for the Bundle Identifier, it should be unique and not repeated or related to any other application.

For Team, this should be your account.

How can we manage this one or how can we download the certificate?

From the Xcode menu, you can click on "About Xcode" - this is the version information for Xcode, but here you can also click on "Preferences" and under "Preferences", we have an account and this is my account.



Here, we can manage the certificates or download the manual profile.

For "Manage Certificates", here we can get the signing certificates for my account.



I will click on the "+" to create the Apple development account, but I already have a current Development certificate, which has a pending certificate request.

I already have one here but in your case, you will request a new one and it will be displaying something like this one.

For "Download Manual Profiles", you can click on this one.

In the end, you should assign your Team, which is your personal account or personal team, or you can add another account if you have one.

The "Bundle Identifier" should be unique to be able to download or install the application on an iOS real device.

Then for the "Provisioning Profile", this is managed by Xcode, and for "Signing Certificates" is Apple Development.

When we click on the run or build the application, you should select the real device from here because all of these devices are simulators, but the real devices would be inside where it says "No Devices" here because no devices are connected for the time being, but you should select this device when you connect to a real device from here.



After that, you can run or build your application and it will build and run successfully on your real or physical device.

For now, we'll build for iOS and in this case, with simulators, it doesn't require the certificates, but if we are running on or building on a physical device, in this case, it should be added as a signing certificate and the provisioning profile in our application.



Now our application is installed and it's opened successfully, and this will be the same case for the real device, but we should do these steps to be able to run our application and run our test after that using Appium on the physical or real devices.



Resources



Quiz

The quiz for this chapter can be found in Chapter 3.8

© 2024 Applitools. All rights reserved. Terms and Conditions Privacy Policy GDPR