Terminal
Terminal/Skill
Sets up Maestro and writes and runs end-to-end UI test flows for the iOS and Android apps in a project.
By Builder.io
Works with
npx skills add builderio/builder-agent-skills --skill mobile-testingMaestro drives the iOS Simulator and Android Emulator with simple YAML
flows. Use it to verify functionality after changes to ios-app/ or
android-app/.
builder.config.json exists in the repo root with the required allowedCommands (see "Verify builder.config.json" below); create or update it if missing.maestro --version); if not, install it.maestro/ or create one for the new feature.Before running any Maestro commands, ensure builder.config.json exists in the repository root and contains the following allowedCommands list. Without these entries the required shell commands (maestro, xcrun, xcodebuild, ./gradlew, adb, etc.) will be blocked by ACL policy.
{
"allowedCommands": [
"npm *",
"pnpm *",
"yarn *",
"yarn",
"bun *",
"bun",
"gh *",
"wc *",
"gradle *",
"gradle",
"rg *",
"./gradlew *",
"./gradlew",
"adb *",
"adb",
"vp *",
"vp",
"git *",
"export *",
"rails *",
"gem *",
"bundle *",
"rake *",
"echo *",
"cd *",
"find *",
"ls *",
"rm *",
"cp *",
"mv *",
"pwd",
"curl *",
"npx tsc *",
"head *",
"lsof *",
"kill *",
"ps *",
"tr *",
"awk *",
"cat *",
"grep *",
"sed *",
"tail *",
"touch *",
"mkdir *",
"tee *",
"true",
"uniq *",
"test *",
"false",
"npx *",
"sort *",
"env",
"dirname",
"basename *",
"realpath *",
"readlink *",
"stat *",
"file *",
"diff *",
"xargs *",
"chmod *",
"which *",
"whoami",
"uname *",
"uname",
"date",
"date *",
"printenv *",
"sleep *",
"netlify *",
"node *",
"tsx *",
"builderio *",
"builder *",
"open *",
"xcrun *",
"xcodebuild *",
"xcode-select *",
"xed *",
"agvtool *",
"maestro *",
"maestro"
]
}
If the file is missing, create it. If it exists but lacks any of the entries above, merge them in without removing existing allowed commands.
Run only if maestro --version fails.
curl -Ls "https://get.maestro.mobile.dev" | bash
export PATH="$PATH:$HOME/.maestro/bin"
maestro --version
Platform prerequisites:
adb on PATH.iOS (simulator build):
cd ios-app
xcodebuild -project movie-rater.xcodeproj \
-scheme movie-rater \
-sdk iphonesimulator \
-configuration Debug \
-derivedDataPath build
Resulting .app: ios-app/build/Build/Products/Debug-iphonesimulator/movie-rater.app
Android (debug APK):
cd android-app
./gradlew :app:assembleDebug
Resulting .apk: android-app/app/build/outputs/apk/debug/app-debug.apk
iOS:
xcrun simctl boot "iPhone 15" || true
open -a Simulator
xcrun simctl install booted <path-to>.app
Android:
emulator -list-avds
emulator -avd <AvdName> &
adb wait-for-device
adb install -r <path-to>.apk
maestro test maestro/ios/smoke.yaml
maestro test maestro/android/smoke.yaml
maestro test maestro/ # run all flows
Useful flags:
--format junit --output report.xml for CI.maestro studio opens an interactive inspector (great for finding
selectors when authoring a new flow).maestro hierarchy dumps the current screen's view tree.Directory layout to follow:
maestro/
ios/ # iOS-specific entry flows
android/ # Android-specific entry flows
shared/ # reusable sub-flows
Minimum flow shape:
appId: com.example.movierater # iOS bundle id or Android package
---
- launchApp:
clearState: true
- assertVisible: "Movies"
- tapOn:
id: "movie-card-title"
- assertVisible: "Details"
Authoring steps:
maestro studio against a running app to discover selectors.id: selectors backed by stable accessibility identifiers..accessibilityIdentifier("movie-card-title")android:contentDescription or resource idModifier.testTag("movie-card-title") with
semantics { testTagsAsResourceId = true }maestro/shared/ and runFlow: them.After running tests, surface to the user:
~/.maestro/tests/<run>/ logs.appId differs per platform — use the iOS bundle id in maestro/ios/
flows and the Android package name in maestro/android/ flows.maestro test runs; Maestro does not build apps.id: selectors with accessibility identifiers.testTag is invisible to Maestro unless
testTagsAsResourceId = true is set on the semantics root.xcrun simctl shutdown all.adb wait-for-device before
installing or testing.