Who it is forA developer whose native iOS or Android build keeps failing and who wants the agent to read the compiler or Gradle output and correct the code without copied logs.
The problemCopying build errors and logs back into a chat is slow, and the fix cycle repeats each time the build breaks.
The outcomeThe agent runs the app, reads the first build error and log tail, edits the code, and reruns until the app launches or it reports the blocker.
What you need first
- macOS with Xcode for iOS previews
- Node 20 or newer (serve-sim needs it)
- Android SDK platform-tools with at least one AVD for Android previews
- A JDK that your project's Gradle version supports
- Bun, for the install from source path
Steps
- Run
curl -fsSL https://raw.githubusercontent.com/hsandhu/mobilecode/main/install | bashto install MobileCode. - Open the mobile project as a session. The device pane opens by itself when you open the session.
- Ask the agent to build and launch the app for the platform that fails, so it calls the device_run tool.
- Let the agent read the build error and log tail returned by device_run, edit the code, and run again.
- Watch the status move through Building, Installing, Launching and Running, and open the full build log from the device pane if needed.
Prompt for your agent
In the MobileCode repo at https://github.com/hsandhu/mobilecode, use the device_run tool to build and launch the <platform> app in the project at <project-path>. Read the build error and log tail on failure, fix the code, and rerun. Report the final status and the changed files. Verify that the last run reached Running before stating the build is fixed.
Caveat. The agent can only fix what the build log shows, so a failure caused by missing SDKs, certificates, or a JDK version still needs you to install the requirement.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for hsandhu/mobilecode and "Let an agent fix a failing mobile build on its own"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer