IMPORTANT Generate an API key on our frontend

Getting started with Xcode

iOS only - Fastest way to get started, for those without Appium setup on their machine

Setup Xcode

1

Open Xcode

Open an existing project or create a new project in Xcode.

Follow these steps if you’re creating a new project.

2

Add package dependency

In the top menu bar go to File -> Add package dependencies

3

Search for package

In the search field in the top right corner paste https://github.com/qaml-ai/qaml-swift

4

Click add package.

5

Select target

Select your UITest target, NOT your main app target.

Writing Tests in qaml-swift

1

Go to a test File

2

Import qaml

Include import qaml at the top of your test file

3

Create a new test function

Example test:

@MainActor
func testAppleNews() async throws {
    // Set the bundle ID of the app you'd like to test
    let app = XCUIApplication(bundleIdentifier: "com.apple.news")
    app.launch()
    
    let q = QamlClient(apiKey: "<api key>", app: app)
    
    try await q.execute("click the sports tab")
    try await Task.sleep(nanoseconds: 1 * NSEC_PER_SEC)
    try await q.execute("scroll down")
    try await q.execute("tap the first article")
    try await q.assertCondition("The screen shows a Get Started button")
}
4

Select your device

Select the device you’d like to run your test on at the top.

  • For physical devices, attach your device to your computer via USB.
  • For simulated devices, select your desired device from the drop down menu.
  • For third party device farms, following their XCUITest documentation.
  • AWS Docs, Sauce Labs Docs, Browserstack Docs.

If you have XCode cloud set up, these tests will run as part of your Xcode cloud actions. Apple offers iOS developers 25 hours of free device farm access per month. Read more about this on Xcode’s documentation.