Claude Code checked 149 untouched buttons in an iOS app through UI tests
UI tests had never tapped 149 buttons in an iOS app, and the author did not want to check them by hand. He built a "remote control" into XCUITest, Apple's framework for UI tests: a test launches the app in the required state and executes Claude Code's commands from files. The agent grouped the buttons into 80 checks, and in 46 of them it confirmed a real gap in the tests. As a result, every new autotest also gives the agent a new starting point.
AI-processed from Habr AI; edited by Hamidun News
Imagine a UI test coverage report that shows 149 buttons in an iOS app that autotests never once tapped. Checking each one by hand takes a long time, because many of them live in awkward states: a user without verification, a forced update, a backend error. The author of the story on Habr decided to hand this routine to Claude Code. He set things up so the agent drives the app on a simulator itself, starting from any state the team's existing UI tests already know how to create. XCUITest here is Apple's framework for automated interface tests.
Why the "remote control" was built into the test itself
To check a button, you first have to get to its screen in the right state. The team's existing tests do this better than a human: they pick a suitable user from the test database, substitute backend responses via SBTUITestTunnel, enable feature flags, and open the app through a deep link. External tools such as Appium, idb, or a simulator MCP server see the app from the outside. They can tap, but they cannot prepare the state: they have no stubs and no test users.
So the author went the other way. One long-lived XCUITest launches the app like any ordinary test, writes a ready file, and waits for commands. Commands arrive as text files, cmd-N.txt: the simulator runs on the same Mac and can see its file system, so no ports or server were needed. The test executes the command, writes the response to out-N.txt, and saves a screenshot, shot-N.png. The agent reads the text, looks at the picture, and decides what to do next. Afterward, a person opens the same folder and walks through the session step by step.
Launch scenarios are copied from existing tests with a comment noting where they came from. On the first day there were 25 of them, and a new one takes 5–15 lines. If no command arrives for 40 minutes, the test ends on its own. The agent looks up elements by accessibility ID, and when an ID is missing, that goes into the report as an accessibility task.
Numbers and pitfalls
Over the first three days, the client handled 227 calls containing 718 commands, about three per call. The most frequent were wait (283), tap (218), and tree (170). A call that returns a response and a screenshot takes about 10 seconds. From start to ready with a finished build takes 127 seconds at the median (19 runs, ranging from 85 to 189); a cold build takes longer.
The most unpleasant bug: the agent called typeText on a field outside the screen, XCTest crashed the test, and the test plan's retry of failed tests relaunched the driver with a different user. The agent kept working in someone else's state. The fix: no single action may bring down the test. Before tapping, the driver checks that the element exists and can be tapped; otherwise it returns text such as NOT FOUND or NOT HITTABLE.
There was also a routine problem: Claude Code asked for confirmation on every command chained with ; or |. A rule in permissions.allow fixed it, but it only matches exactly one client command. So the client now accepts several commands separated by --, and the element tree filter moved inside.
There were plenty of small issues too. SwiftUI toggles do not switch when tapped in the center of the row, so a tapAt aimed at the switch itself was needed. swipeUp scrolls an entire screen, so a drag was added for precise scrolling. Identical labels cause the wrong button to be tapped, so the driver tries the id first. System alerts belong to SpringBoard, and the driver does not always see them.
What the agent found
Two illustrative sessions. In the first, the backend introduced mandatory acceptance of terms before the first stake. On DEV, the agent got to the confirmation, found a checkbox below the first screen and an inactive Stake button, ticked the checkbox, and reached the success screen. Along the way it also found in the code where the app decides to show the terms. This took 54 commands.
In the second, the author needed to buy €12 worth of bitcoin with a card requiring 3DS and record a video. The agent completed the whole path in about four minutes (the video runs 4:35). Along the way it noticed something it had not been asked about: saved cards on the payment selection screen have a "›" arrow, but tapping it is not handled in the code. And the card payment screens still contained text about bank transfers.
The main output was the coverage report. The agent went through the 149 buttons, which grouped into 80 check lines: about 57 were verified in the app, and another 23 through the code. For each one, it looked for the test that should have tapped it, tapped the button itself, and recorded the result. In 46 cases the gap was confirmed: the test really does not exist, and sometimes a Page Object method exists but no test calls it.
The practical takeaway for mobile teams: no separate infrastructure for the agent is required. Accumulated autotests already know how to bring the app into the needed state, and the more of them there are, the more starting points the agent has. To begin, it is enough to extract three to five launch scenarios and configure permissions so the agent does not ask for confirmation at every step. Also keep in mind that the driver depends on the UI test code, so an edit to a helper can break a scenario.
- Nov 29, 2026Anthropic Rewrote Its Core API in Rust with Claude and Cut Compute Use by 70%
- Nov 29, 2026An Android developer built Phasm, a lightweight Swift IDE centered on a terminal with agents
- Nov 29, 2026Anthropic Publishes Seven Free Claude Setup Kits on GitHub
- Nov 29, 2026Ten Popular Skill Sets for Claude Code: The Leader Has 332K Stars on GitHub
Key Questions Answered
Why the "remote control" was built into the test itself?
To check a button, you first have to get to its screen in the right state. The team's existing tests do this better than a human: they pick a suitable user from the test database, substitute backend responses via SBTUITestTunnel, enable feature flags, and open the app through a deep link. External tools such as Appium, idb, or a simulator MCP server see the app from the outside. They can tap, but they cannot prepare the state: they have no stubs and no test users. So the author went the other way.
What are the key details on Numbers and pitfalls?
Over the first three days, the client handled 227 calls containing 718 commands, about three per call. The most frequent were wait (283), tap (218), and tree (170). A call that returns a response and a screenshot takes about 10 seconds. From start to ready with a finished build takes 127 seconds at the median (19 runs, ranging from 85 to 189); a cold build takes longer.
What the agent found?
Two illustrative sessions. In the first, the backend introduced mandatory acceptance of terms before the first stake. On DEV, the agent got to the confirmation, found a checkbox below the first screen and an inactive Stake button, ticked the checkbox, and reached the success screen. Along the way it also found in the code where the app decides to show the terms. This took 54 commands. In the second, the author needed to buy €12 worth of bitcoin with a card requiring 3DS and record a video.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
