This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the iOS Simulator CLI - a command-line tool for interacting with iOS simulators. The project follows an intentionally simple single-file architecture where all logic is contained in src/index.ts.
# Install dependencies
npm install
# Build the TypeScript project (compiles to build/)
npm run build
# Development with automatic rebuild on changes
npm run watch
# Run the CLI
npm start -- --help
ios-simulator-cli get-booted-sim-idThe entire CLI implementation is in src/index.ts (single file by design). The tool:
- Exposes subcommands for iOS simulator interaction
- Wraps
xcrun simctland Facebook'sidbcommands - Validates all inputs with Zod schemas
- Implements security best practices with
--argument separation - Handles output paths with
IOS_SIMULATOR_CLI_DEFAULT_OUTPUT_DIRenvironment variable
get-booted-sim-id- Get the currently booted simulator IDopen- Open the iOS Simulator applicationui describe-all- Get accessibility info for the entire screenui tap- Tap at coordinatesui type- Input textui swipe- Swipe gestureui describe-point- Get element at specific coordinatesui find-element- Search accessibility tree for elements by label, identifier, or typeui view- Get compressed screenshot as base64 JPEG or save to filescreenshot- Save screenshot to filerecord-video- Start video recordingstop-recording- Stop video recordinginstall-app- Install an app bundle (.app or .ipa) on the simulatorlaunch-app- Launch an app by bundle identifier
This project requires manual testing on macOS with:
- Xcode and iOS simulators installed
- Facebook IDB tool installed
Test changes by:
- Building with
npm run build - Running commands from
QA.md
- Keep it simple: Single file, minimal dependencies, standard tooling (npm/tsc)
- Real use cases only: Don't add hypothetical features
- Security first: Always use
--separator for user inputs, validate with Zod - No architecture changes without discussion - the single-file design is intentional
For more detailed information, refer to these documentation files:
- README.md - Complete project documentation including installation instructions, available commands, configuration options, and usage examples
- CONTRIBUTING.md - Contribution guidelines, development setup, dependency management, and the project's philosophy of intentional simplicity
- QA.md - Manual quality assurance test cases for validating functionality
- TROUBLESHOOTING.md - Common issues and their solutions, including IDB installation help
- SECURITY.md - Security policy and information about fixed vulnerabilities
- CONTEXT.md - Reference links for iOS simulator commands, IDB commands, and security best practices