Skip to main content

Creating iOS apps


Developed by Apple, XCUITest is a framework for user-interface (UI) testing for iOS applications. LambdaTest lets you perform automated app testing of your iOS apps using XCUITest across 3000+ real devices and OS combinations.

The resigning of application is done to embed our provisioning profile into the uploaded .ipa file. This allows our apps to install and launch on cloud device.

Objectives


By the end of this topic, you will be able to:

  1. Create .ipa files for Appium testing
  2. Create an XCUITest Package
  3. Create .app files for XCUITest testing

1. Create .ipa files for Appium testing

In case you need to maintain your own provisioning profile in the .ipa file, you can go either disable the App Resigning option in the Device settings for your app in the cloud or simply add an Appium capability of resigningEnabled=false. Although, you can configure this for private devices only.

Build an .app bundle

  1. Go to your app project in Xcode.
  2. For your Product's device target select either Generic iOS Device or Any iOS Device (arm64).
  3. Go to the Product menu and select Clean option.
  4. Again go to the Product menu and select Build option.
  5. The .app file is generated in your Xcode project's Products Directory.

Build an .ipa from and .app bundle

  1. Firstly create an empty directory with the name Payload.
  2. Move the .app file to the Payload directly.
  3. Make an archive(.zip file) by compressing the Payload directory.
  4. Rename this archive and append .ipa in the last. This creates an .ipa file.

Build an .ipa file

Any of the existing export methods i.e. Ad Hoc, Enterprise or Development can be used for the distribution for your iOS apps except for the App Store Type.

  1. Go to your project in Xcode.
  2. Choose Generic iOS Device or Any iOS Device (arm64) for the project's device target.
  3. Go to the Product menu and select Clean option.
  4. Again go to the Product menu and select Archive option. Your app will be listed under the Archives after the process is completed.
  5. Choose your app from the list and click export.
  6. Then you would need to choose for an export method. Use any of three listed above (Ad Hoc, Enterprise or Development).
  7. Now set the Distribution options as given below:
    1. App Thinning: None
    2. Unselect the option Rebuild from Bitcode.
    3. Strip swift symbols is optional.
    4. Unselect the option Include manifest for over-the-air installation.
  8. Choose your Distribution Certificate and Provisioning Profile (Automatic or Manual). This will create the .ipa file.
  9. After the process of generation is complete, Export the .ipa file to desired location.
  10. You can use the generated .ipa file for testing on LambdaTest Platform.

2. Create an XCUITest Package

  1. Open your application project in Xcode.

  2. Choose Generic iOS Device or Any iOS Device (arm64) for the project's device target.

  3. Confirm that your UI Tests are included in Target Membership and the said targets are selected to be built in your Xcode Build Scheme. UI Tests Targets are specially selected to be built at the "Test" build action.

    Image
  4. Create your test package by following Product > Build For > Testing.

  5. Go to the Products Directory of your XCode project to find the generated .app file.

3. Create .app files for XCUITest testing

Match the iOS version of your app and test runner iOS Deployment Target. If they don't match up, the tests will run locally, but won't be able to run on LambdaTest Real Devices.

To match the version in your Xcode Project.

  1. Go to the Project that you wish to build.
  2. Go to the Build Settings, set the iOS Deployment Target to the iOS verion of your app. This will align the app and test runner to the same iOS version.

To match the version in your Xcode Target.

  1. Choose the Target of your Project.
  2. Go to the Build Settings, set the iOS Deployment Target to the iOS verion you want to use in your test.
Warning

This process will overwrite the Build settings at the Project Level to the given iOS version. While using this method, take note that the Targets can be out of sync with each other and the project settings, which will cause the tests to break. You would need to re-build the Project if you change the iOS version for one target output in order to keep all your targets in sync.