Skip to main content

LambdaMax XCode Plugin

LambdaTest have developed a new plugin to help developers execute tests on the LambdaTest Grid directly from the XCode (via LambdaMax). The all-new LambdaTest plugin will allow developers and testers to directly run automated tests based on XCUIT (XCode) framework on the LambdaTest real device cloud.

XCUITest is a testing framework that can be used to automate UI tests for native iOS and macOS applications. The framework uses XCTest, an integrated testing framework developed by Apple. You can write automated UI tests using the XCUITest framework in Swift or Objective-C programming language.

With this new plugin, testers and developers never have to leave XCode to execute a test on LambdaTest’s real device cloud. Follow these steps to install LambdaMax plugin:

How to Install LambdaMax Plugin

  1. On Xcode on your machine.
  1. Head to Product on the menu bar in the top-left corner.
  1. Hover on the Scheme option from the dropdown and click on the Edit Scheme from the dropdown list.
  1. In the pop-up window, click and expland the Build option from the sidebar.
  1. Head to the Post Actions option from the sidebar and copy the sample code.
  1. Click on + icon to add “New Script Run Action”. You can change the path and capabilities as per your preference, which will reflect directly on the LambdaTest Grid.

Here is the sample code for the Xcode plugin:

Xcode plugin:
Custom Xcode Script and Images attached below:


# Debug/Release build name if required
# Created by Ankit Agarwal on 08/11/22.

AppUploadResponse=$(curl -w --location --request POST 'https://{username}:{accessKey}' --form 'name="{name}"' --form 'appFile=@"{filePathWithNameAndExtension}"' --form 'custom_id="{custom_id}"')

appId=$(awk '{sub(/.*\"app_url\":\"/,"");sub(/\",\"url.*/,"");print}' <<< "$AppUploadResponse")

echo "$appId"

TestAppUploadResponse=$(curl -w --location --request POST 'https://{username}:{accessKey}' --form 'name="{name}"' --form 'appFile=@"{filePathWithNameAndExtension}"' --form 'custom_id="{custom_id}"')

testAppID=$(awk '{sub(/.*\"app_url\":\"/,"");sub(/\",\"url.*/,"");print}' <<< "$TestAppUploadResponse")

echo "$testAppID"

TestExeuctionPayload="{\"app\": \"$appId\", \"testSuite\": \"$testAppID\", \"device\": [ \"iPhone X-14\" ], \"tunnel\": false, \"network\": true, \"devicelog\": true, \"queueTimeout\": 3000, \"idleTimeout\": 200, \"build\": \"otrium1\", \"project\": \"testerror\" }"

echo "$TestExeuctionPayload"

XCUITTestExecution=$(curl -w --location --request POST 'https://{username}:{accessKey}' --header 'Content-Type: application/json' --data-raw "$TestExeuctionPayload")

echo "$XCUITTestExecution"

Note: By clicking on the Play button in the top left corner, the script will automatically run on the LambdaTest Grid.

  1. In the above code, update the required LambdaTest credentials - {Username:AccessKey}. You can access your credentials under the profile section.
  1. Along with this, you need to update the {FilePathWithNameAndExtension} with the path where your app and test suite is in local.