macos-xcode
Xcode: CLI tools, simulators, signing, provisioning profiles, xcrun, xcodebuild, Instruments
What this skill does
# macos-xcode
## Purpose
This skill equips the AI to handle Xcode-related tasks on macOS, focusing on building, testing, and deploying iOS/macOS applications using command-line tools. It covers core functionalities like code signing, simulator management, and profiling to automate development workflows.
## When to Use
Use this skill for tasks involving iOS app compilation, simulator testing, or provisioning profile management. Apply it in CI/CD pipelines for macOS builds, when debugging with Instruments, or for automating xcodebuild processes. Avoid it for non-Apple platforms or GUI-only Xcode interactions.
## Key Capabilities
- Execute xcodebuild commands for building, archiving, and testing projects.
- Manage simulators via xcrun simctl, including booting devices and installing apps.
- Handle code signing with security commands, provisioning profiles, and certificates.
- Profile applications using Instruments for performance analysis.
- Query Xcode installations with xcrun to locate tools and SDKs.
- Automate workflows for iOS/macOS apps, including scheme selection and configuration management.
- Integrate with macOS keychain for secure handling of signing identities.
## Usage Patterns
Always run commands in a macOS environment with Xcode installed. Prefix xcodebuild/xcrun calls with checks for Xcode availability, e.g., verify `$xcode-select -p` outputs a valid path. Use in AI responses by generating bash scripts that wrap these commands, ensuring error redirection (e.g., `> output.log 2>&1`). For automation, embed in Python scripts via subprocess: import subprocess and call `subprocess.run(['xcodebuild', '-list'])`. Handle paths dynamically, using environment variables like `$DEVELOPER_DIR` to point to Xcode installations.
## Common Commands/API
- Build a project: `xcodebuild -project MyApp.xcodeproj -scheme MyScheme -configuration Release build`
- List schemes: `xcodebuild -list` (use output to parse available schemes in scripts).
- Boot simulator: `xcrun simctl boot "iPhone 15"`; followed by `xcrun simctl install booted MyApp.ipa`
- Code signing: `xcodebuild -exportArchive -archivePath MyApp.xcarchive -exportPath output.ipa -exportOptionsPlist ExportOptions.plist` (create ExportOptions.plist with {"method": "app-store"}).
- Run Instruments: `instruments -w "iPhone 15" -t Time Profiler MyApp`
- Query tools: `xcrun --find xcodebuild` to get the path; use in code: `path = subprocess.check_output(['xcrun', '--find', 'xcodebuild']).decode().strip()`
- Provisioning profiles: Use `security find-identity -v -p codesigning` to list certificates, then specify in xcodebuild via `-signingIdentity "iPhone Developer: Name (ID)"`.
## Integration Notes
Integrate by setting up environment variables for sensitive data, e.g., use `$XCODE_SIGNING_IDENTITY` for code signing identities. For CI/CD, ensure Xcode is installed via `xcode-select --install` and set `$DEVELOPER_DIR=/Applications/Xcode.app`. When combining with other skills, pipe outputs (e.g., from macos-core for file ops). For API-like interactions, wrap xcrun/xcodebuild in RESTful services, but use env vars like `$APPLE_DEVELOPER_KEY` if accessing Apple services. Always check for Xcode version compatibility, e.g., require >=14.0 for certain simctl features.
## Error Handling
Check for common errors like "Code Sign error: No matching provisioning profile found" by verifying profiles with `security cms -D -i profile.mobileprovision`; fix by running `xcodebuild -fixit` or updating ExportOptions.plist. For simulator issues (e.g., "Device not booted"), use `xcrun simctl list devices` to check status and boot via script: if device not booted, run `xcrun simctl boot <udid>`. Handle xcodebuild failures by parsing exit codes (e.g., code 65 for build errors) and log outputs. Use try-except in scripts: try: subprocess.run([...]) except subprocess.CalledProcessError as e: print(e.output). Always include `--verbose` flag for detailed logs.
## Concrete Usage Examples
### Example 1: Build and Archive an iOS App
To build and archive a project, first ensure Xcode is selected: `xcode-select -s /Applications/Xcode.app`. Then run:
```bash
xcodebuild -workspace MyApp.xcworkspace -scheme MyScheme -configuration Release archive -archivePath build/MyApp.xcarchive
xcodebuild -exportArchive -archivePath build/MyApp.xcarchive -exportPath output -exportOptionsPlist options.plist
```
This outputs an IPA file; use in AI responses to automate app packaging for testing.
### Example 2: Launch Simulator and Install App
To test on a simulator, boot a device and install an app:
```bash
xcrun simctl boot "iPhone 15"
xcrun simctl install booted MyApp.ipa
xcrun simctl launch booted com.example.MyApp
```
Monitor via `xcrun simctl status booted`; integrate this into AI workflows for automated UI testing.
## Graph Relationships
- Connected to: macos (cluster), due to shared macOS dependencies.
- Related to: ios (tag), for overlapping iOS build processes.
- Links with: build (tag), for integration with other build tools.
- Associated with: signing (tag), for certificate management in related skills.
- Overlaps with: xcode (tag), as a core component in macOS development ecosystems.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.