/baguette:baguette-test-appfrom baguette
Tests iOS apps on a simulator by reading the screen, deciding what to tap, and verifying results using the baguette CLI. Useful for QA, user flow verification, and in-app task completion.
Ships in baguette. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The test is a loop you do yourself, not a script you write:
read the screen → think what's next → click → check it worked.
Your judgment is the point. A script can only find what it was told to look for; you can notice that the price is wrong.
baguette list --json # a booted UDID
baguette boot --udid <X> # if none is running
xcrun simctl install <X> path/to/App.app # if it isn't installed
If the user wants to watch, start baguette serve and give them
http://localhost:8421/devices/<X>.
Write down what success looks like before the first click, in the user's words. "Signed up" isn't enough: "a new account, on the free plan, with the receipt emailed".
1. Open the app and read the screen, in one call.
baguette launch --udid <X> --bundle-id <id> --relaunch --then-describe-ui
It waits for the first real screen, usually 4 to 5 seconds. Baguette logs to stderr,
so add 2>/dev/null if you only want the answer.
2. Read the answer and think. It says what you can do next, each with the command to run and the names it takes:
{"ok":true,"changed":true,
"affordances":{"fill":{"command":"baguette fill --udid X --label '<name>' --text <text>","names":["Name"]},
"tap":{"command":"baguette tap --udid X --label '<name>' --then-describe-ui","names":["Back","New List"]}},
"disabled":["Share List"],
"text":["My Lists"],
"values":{"Home":"1"}}
affordances: what you can do next. Run the command with one of its names, filling
in anything else like <text>. fill is for a text field, type for one that has focus,
and swipe <name> is a slider's own command, because a press can't set its value.disabled: controls that can't be used yet. Do what they're waiting for first.text: what the screen says. Some of it can be tapped too, like a Show more link.values: a control's value, like a switch's 1 or the selected tab's.Read what's there before choosing: the first row is rarely the one the task means.
A long answer can list over a hundred names, sorted by name. To find one, filter for it instead of cutting the answer off, because what you need may be anywhere in it:
... 2>/dev/null | jq -r '.affordances.tap.names[] | select(test("New List|Continue"))'
3. Tap by name, and read, in one call.
baguette tap --udid <X> --label 'Groceries' --then-describe-ui
Use single quotes, so a $ in a name like Total $20 stays as it is. A name can be part of a label,
as long as it matches only one element. baguette waits for the element and for the
screen to settle, so don't add a sleep. The answer is the next screen, so go back
to step 2.
If the name is wrong or matches several, nothing is tapped, and the answer says why
and lists visible or matches. "used":"touch" means baguette couldn't find the
element to press, so it touched it instead.
4. Check it worked. Is this the screen you expected? Selections don't always show
in the answer, so look for their effect: a button that now says Continue with Groceries,
or Share List leaving disabled.
Scrolling isn't needed to tap. A press reaches a control wherever it is. To read
more of a list, use baguette swipe with --then-describe-ui. changed:false means
nothing moved: usually the end of the list, but possibly a spot that doesn't scroll, so
take a screenshot if it matters. Long lists load rows as they scroll, so the answer only
lists what's loaded.
Several clicks you're already sure of go in one call. Each waits for its element, so you can name what the next screen will show, if the task already tells you:
baguette input --udid <X> 2>/dev/null <<'EOF' | tail -1
{"type":"tap","label":"New List","then_describe_ui":true}
{"type":"tap","label":"Choose a Template","then_describe_ui":true}
{"type":"tap","label":"Blank","then_describe_ui":true}
EOF
Stop wherever the next choice depends on what appears. A failed click doesn't stop
the ones after it, so put anything you can't undo, like Delete Account, in its own call.
--label presses through accessibility, as VoiceOver does. So it can reach what a
finger can't, like a row under a tab bar or off screen. That's right for
getting through a task, but it can hide a bug where users can't reach something.
Use --touch for a real finger when you're testing that a user can tap something,
or when a press had no effect but the control looks live:
baguette tap --udid <X> --label 'New List' --touch --then-describe-ui
It refuses an element off screen. A changed:false here can be a real finding, or
just a blank spot in a wide row: check with a screenshot.
"changed":false means the app's own tree didn't change, and the answer says what it
knows in hint, plus a try with a better way if it has one. baguette never retries for
you, because the app may have acted anyway: check before tapping Delete Account a
second time.
"changed":true doesn't prove the tap did what you wanted either. It only means the
screen is different, so check the result. For what matters, take a screenshot.
baguette screenshot --udid <X> --output /tmp/s.jpg, then read it.baguette heal --udid <X>. It restarts SpringBoard and running apps die.Web content isn't in the tree changed watches. A link that loads a page still shows
up, but a change inside a page may not.
tap,
because their role doesn't say they respond. Try them by name if they look tappable.
Some controls have no useful name, like RadioButton #3: a screenshot shows which is which.points = image pixels × screen.width ÷ image width. baguette describe-ui --udid <X> has screen, every frame and the full tree.type is US-ASCII only; anything else goes through paste.Finish with what you verified against the success you wrote down, from what's on the final screen rather than from what you meant to do:
Never report a pass because taps returned ok:true.
examples/Skylark in the baguette repo is an app built for this, with a task and a
known right answer in its README. To test yourself fairly, get the task from someone
else rather than reading the README first.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tddworks/baguette --plugin baguette2 skills in this plugin
Other plugins' skills for the same job