Instrumenting tvOS apps

Use CocoaPods to instrument an Apple TV application in a few easy steps. At this point you should have a working Apple TV device in your Suitest account.

Suitest supports native, TVML and hybrid (combination of native and TVML) apps written in Objective-C or Swift.

In case of testing on real devices, Suitest supports only .ipa package file extension. See Uploading package to Suitest section below.

In case of testing on simulator, Suitest supports only .zip package file extension. See Uploading Apple TV simulator builds section below.


Instrumenting Apple TV apps written in Swift (Native and TVML)

  1. Include the Suitest instrumentation library for Apple TV by adding a dependency to your Podfile:

    target 'Target' do
        pod 'Suitest'
    end
    

    Check the official Podfile guide for more information about using the Podfile.

  2. Add SuitestLauncher.instance.start() to your AppDelegate file. The final result should look like the following:

    import Suitest
    func applicationDidBecomeActive(_ application: UIApplication) {
        SuitestLauncher.instance.start()
    }
    

Instrumenting Apple TV apps written in Objective-C (Native and TVML)

  1. Include the Suitest instrumentation library for Apple TV by adding a dependency to your Podfile:

    target 'DevelopmentTarget' do
        pod 'Suitest'
    end
    
    # Suitest instrumentation library is written in *Swift*, so the Objective-C
    # compiler may complain about not knowing the Swift version.
    # The below makes the compiler happy.
    
    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end
    end
    

    Check the official Podfile guide for more information about using the Podfile.

  2. Add [[SuitestLauncher instance] start] to your AppDelegate file. The final result should look approximately like so:

    #import <Suitest/Suitest-Swift.h>
    - (void)applicationDidBecomeActive:(UIApplication *)application {
        [[SuitestLauncher instance] start];
    }
    

Using Swift Package Manager

  1. Open Xcode
  2. Go to your project
  3. Click on the project icon
  4. Go to Swift Packages tab
  5. Add new package with + button
    Opening the project in Xcode
  6. Modal window will open a) Enter the URL of the repository b) Use version rules and select/insert the rest of the information based on your needs
    Modal window for the package details on older Xcode versions
    Modal window for the package details from Xcode 13

Uploading package to Suitest

After you have instrumented the code create a development build of your app and upload it at the Suitest configuration (Settings tab) page. Suitest will automatically install or update the package on the device as necessary when you try running the app.

If you are using or planning on using Apple TV Simulators. Create a separate configuration and upload a specific file to be used on simulators. Refer to the uploading Apple TV simulator builds section.

If you use Suitest Network API you can also send the package with an API request. Suitest will automatically install or update the package on the device as necessary when you try running the app on this device.

App package signing

According to Apple code signing guidelines the app package must be signed with a certificate allowing it to run on a particular device. You should make sure that this has been followed before you attempt to run the app through Suitest on your device. Suitest does not attempt to sign the app.

Important: Make sure you are correctly logged into Xcode with your developer account, to avoid code signing issues. Check how to login into Xcode.

App Store/TestFlight builds

Due to Apple restrictions, Suitest cannot automatically install App Store and TestFlight builds on a device. In order to use these types of builds for testing with Suitest, you must install the app on a device manually and upload the same build to Suitest.

Before uploading to the App Store

Suitest is intended for testing environment, however, it can be uploaded to the Apple App Store if you decide to do so at your own risk. The instrumentation library is in an inactive state until it is opened or ran through Suitest.

If you decide to upload your application to the App Store and wish to test your live application, make sure that the package uploaded to the App Store is also the package uploaded to your Suitest configuration. If Suitest finds that the current running app on the device (from the App Store) is a different version to what is in the configuration, it will automatically install and run the application package from the configuration you have currently selected.

suitester

The tvOS/iOS suitester sets the AccessibilityIdentifier for elements that do not have this attribute set in your application. To improve reliability of XPath selectors. Check the suitester section for more information.

Uploading Apple TV Simulator builds

For the simulator, the .ipa files are not suitable. Instead, we need build for the x86_64 architecture. This can be achieved by doing the following:

  1. Select the simulator in Xcode.

    Simulator selected

  2. Build the project - Product > Build or [CMD] + B.

    Build the project

  3. Show inside of finder.

    Show the product in finder

  4. Find the package inside of folder.

    Package to be uploaded to Suitest configuration (Settings)

  5. Archive the package to a .zip file.