This guide walks you through installing the Marathon Cloud CLI, obtaining an API key, and running your first test suite. If you do not have test binaries to hand, step 3 has prebuilt samples so you can see a run end to end first.
-
Install the CLI
Section titled “Install the CLI”Terminal window brew tap malinskiy/tap && brew install malinskiy/tap/marathon-cloudUse Homebrew to install the Marathon Cloud CLI on macOS or Linux.
For other platforms, refer to the CLI installation guide.
-
Obtain an API key
Section titled “Obtain an API key”In the Marathon Cloud console, open the user menu and choose Tokens, then create a token and export it:
Terminal window export MARATHON_CLOUD_API_KEY=YOUR_TOKENSee API keys for storing it in CI.
-
Prepare your application
Section titled “Prepare your application”Terminal window ./gradlew :app:assembleDebug :app:assembleDebugAndroidTestRun the Gradle task to build the debug APK and the test APK.
Terminal window xcodebuild build-for-testing \-workspace YourApp.xcworkspace \-scheme YourApp \-destination 'generic/platform=iOS Simulator' \-derivedDataPath buildBuild for the simulator; Marathon Cloud runs iOS tests on ARM64 simulators, so a device build will not run.
Prebuilt binaries from the samples repository, if you want to see a run before wiring up your own project:
Terminal window curl -LO https://github.com/MarathonLabs/samples/releases/download/samples-2023.06/sample-app.apkcurl -LO https://github.com/MarathonLabs/samples/releases/download/samples-2023.06/sample-app-androidTest.apkcurl -LO https://github.com/MarathonLabs/samples/releases/download/samples-2023.06/sample-ios.zipcurl -LO https://github.com/MarathonLabs/samples/releases/download/samples-2023.06/sample-iosUITests-Runner.zipUse
sample-app.apk/sample-app-androidTest.apkin place of the Android paths below, orsample-ios.zip/sample-iosUITests-Runner.zipfor iOS. -
Run your first test
Section titled “Run your first test”Terminal window marathon-cloud run android \--api-key YOUR_API_KEY \--application app/build/outputs/apk/debug/app-debug.apk \--test-application app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apkTerminal window marathon-cloud run ios \--api-key YOUR_API_KEY \--application build/Build/Products/Debug-iphonesimulator/YourApp.app \--test-application build/Build/Products/Debug-iphonesimulator/YourAppUITests-Runner.appThe CLI uploads the binaries, waits for the run, and streams progress.
-
Read the result
Section titled “Read the result”When the run finishes the CLI prints a link to the report and exits
0if every test passed or1if any failed. Open the link for per-test video, logs, and the Allure report. Add--output ./resultsto download JUnit XML and artifacts locally.
Next steps
Section titled “Next steps”- Learn more about Android setup or iOS setup.
- Configure CI/CD integration for automated testing.
- Explore CLI parameters for advanced configuration.