When the user asks you to build, run, test, clean an Xcode project, or manage iOS simulators, you MUST use the global xcbuddy CLI tool instead of raw xcodebuild or xcrun simctl.
xcbuddy is installed globally at ~/.local/bin/xcbuddy. You may need to ensure it is in the PATH (e.g., export PATH="$HOME/.local/bin:$PATH" && xcbuddy build).
When actively developing and testing, ALWAYS recommend or use the xcbuddy i (interactive) command first. It launches a beautiful, boxed UI terminal dashboard with keyboard shortcuts for building, running, and streaming logs without spamming the main terminal.
- interactive:
xcbuddy iorxcbuddy interactive. Launches the visual REPL dashboard. Shortcuts:r(Run),b(Build),t(Test),s(Select Simulator),c(Clean),l(Logs),q(Quit). - build:
xcbuddy build(uses default scheme) orxcbuddy build -d "16 Pro" - run:
xcbuddy run(builds and launches app on booted simulator) orxcbuddy run -d "15 Pro Max"(boots specifically requested simulator by fuzzy name matching, installs, and launches). - test:
xcbuddy test,xcbuddy test --only "Tests/LoginTests", orxcbuddy test --coverage(generates/opens code coverage report). - clean:
xcbuddy clean(standard clean) orxcbuddy clean --deep(automatically finds and deletes the specific derived data folder hash for the project). - open:
xcbuddy open(opens project in Xcode) orxcbuddy open --derived-data(opens the project's DerivedData in Finder). - info:
xcbuddy info(displays project targets, schemes, and configurations). - lint/format:
xcbuddy lintorxcbuddy format(runs swiftlint/swiftformat if installed). - spm:
xcbuddy spm update,xcbuddy spm resolve,xcbuddy spm clean(Swift Package Manager integrations). - create:
xcbuddy create MyProject --type executable(initializes a new project). - sim list/boot:
xcbuddy sim list(formatted list of available simulators) orxcbuddy sim boot "14". - logs:
xcbuddy logs(streams console output from the booted OS) orxcbuddy logs -p "My App"(filters logs by process target name).
- DO NOT use
-workspaceor-projectarguments withxcbuddy. It automatically detects.xcworkspace,.xcodeproj, andPackage.swiftin the current working directory. - DO NOT use long destinations like
-destination "platform=iOS Simulator,name=iPhone 16 Pro".xcbuddyis smart and handles fuzzy matching natively via the-dor--destinationflag (e.g.,-d "16 Pro").