Claude Code is a terminal agent. iOS development is mostly Xcode. The two fit together better than you might expect, because nearly everything Xcode does has a command line form that an agent can run, read and react to. This post sets up a working loop for a new or existing iOS app.
The bigger picture, including Android, is in Claude Code for mobile app development.
What you need
- A Mac with Xcode installed. Apple’s tools only run there.
- A Claude plan or Console account. Anthropic’s quickstart lists “Pro, Max, Ultra, Team, or Enterprise”, a Claude Console account, or a supported cloud provider.
- An Apple Developer account when you want to ship. For running on your own phone, Flutter’s iOS guide notes that “a personal Apple Developer account is free and works.” See Apple Developer account cost for the paid program.
Install Claude Code
Anthropic’s recommended install on macOS:
curl -fsSL https://claude.ai/install.sh | bash
Or with Homebrew:
brew install --cask claude-code
Anthropic notes that “Homebrew installations do not auto-update”, so run brew upgrade claude-code now and then. Check the install with claude --version, then start it from your project folder with claude.
Prepare Xcode’s command line tools
An agent can only build what the terminal can build. Flutter’s iOS setup page gives a clean sequence that applies to any iOS project:
sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
sudo xcodebuild -license
xcodebuild -downloadPlatform iOS
The first line points the command line tools at your Xcode. The second accepts the license. The third downloads iOS platform support and Simulator runtimes. Run these yourself, since they need sudo.
Choose your stack before the first prompt
Decide this up front and write it down, because the agent will otherwise mix approaches:
- Native SwiftUI if you are iOS only and want Apple’s newest APIs first. See Claude Code with SwiftUI.
- Flutter if you want iOS and Android from one codebase. See Flutter project setup with Claude Code.
- React Native with Expo if your team lives in TypeScript. See Claude Code for React Native and Expo.
If you are still deciding, Flutter vs native for indie developers walks through the trade.
Write CLAUDE.md
Anthropic describes CLAUDE.md as the place for “build and test commands, coding standards, architectural decisions, naming conventions, and common workflows.” Running /init generates a first draft: “Claude analyzes your codebase and creates a file with build commands, test instructions, and project conventions it discovers.”
Then edit it. A useful iOS version is short:
## MyApp
- SwiftUI, iOS 17+. No UIKit unless wrapping a system view.
- Build: xcodebuild build -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 16'
- Test: xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 16'
- Unit tests: Swift Testing. UI tests: XCTest.
- Do not edit signing settings, entitlements or the bundle ID.
- Strings go in the String Catalog, never hard-coded.
Anthropic’s guidance on size: “target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence.” Put rules that apply to one area in .claude/rules/ files instead, which can be “scoped to specific file paths, so they only load into context when Claude works with matching files.”
The daily loop
A loop that works for most features:
- Plan first. Press Shift+Tab to reach plan mode. Anthropic says Claude then “explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong.”
- Build after each step. Ask Claude Code to run the build command from CLAUDE.md after every change. Compiler errors are cheap to fix one at a time and expensive in a pile.
- Test the behavior. Write a failing test, then the code. The detail is in testing an iOS app with Claude Code.
- Look at it. Run the app in the Simulator and check the screen yourself. A build that passes can still look wrong.
- Commit small. One feature, one commit. It makes
git reverta real undo button.
Be specific in prompts. Anthropic’s quickstart contrasts “fix the bug” with “fix the login bug where users see a blank screen after entering wrong credentials.” The second gets a focused fix.
Claude inside Xcode
Apple’s Xcode documentation describes a coding assistant with Intelligence settings: “To use coding intelligence in Xcode, go to the Intelligence settings and turn on the agents that you want to use.” For chat, there is a “Claude Sonnet & Opus” option where you sign in with your Claude account. Apple also says an agent chosen in the coding assistant “automatically has access to Xcode capabilities, such as building and testing your app.”
This is not the same tool as Claude Code in your terminal. A common split: the Xcode assistant for questions while you are looking at a file, Claude Code for multi-file features, refactors and anything that runs commands.
What to keep in your own hands
Some steps tie to your identity or money, and an agent should not do them unattended:
- Certificates, provisioning profiles and signing.
- App Store Connect: the listing, privacy answers, pricing and submission.
- In-app purchase products and agreements.
- Anything that sends real push notifications or charges real cards.
Claude Code can prepare these (write the release notes, fill a draft of the App Store submission checklist, generate the archive command), but you press the button.
Keep sessions cheap and focused
Long sessions get slow and expensive because, as Anthropic puts it, “Claude Code sends your full conversation with every request.” Habits that help:
/clearbetween unrelated tasks./usageto see what a session costs.- Move rarely used instructions out of CLAUDE.md into skills, which “load on-demand only when invoked.”
Common first-week problems
- Builds pass in Xcode but fail in the terminal. The scheme or destination differs. Put the exact command in CLAUDE.md.
- The agent edits project.pbxproj by hand. Ask it to add files through the project structure your setup uses, and review that diff carefully.
- Old APIs appear. Name your minimum iOS version in CLAUDE.md so the model picks current APIs.
MobileKit packages this loop as skills for Flutter apps, from spec to store, if you would rather not assemble it yourself.
Sources read on the day this post was written: Claude Code: Quickstart, Claude Code: Memory and CLAUDE.md, Claude Code: Manage costs, Flutter: iOS setup, Apple: Setting up coding intelligence and Apple: Writing code with intelligence in Xcode.