/run-device
Build, install, and launch an iOS app on a physical iPhone or iPad entirely from the command line (no Xcode GUI), using xcodebuild + devicectl. Use when the user wants to run, test, or screenshot their app on a real device without opening Xcode.
$ npx -y skills add rshankras/claude-code-apple-skills --skill run-device --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/run-device
Context preview
The summary Claude sees to decide when to auto-load this skill.
Build, install, and launch an iOS app on a physical iPhone or iPad entirely from the command line (no Xcode GUI), using xcodebuild + devicectl. Use when the user wants to run, test, or screenshot their app on a real device without opening Xcode.
SKILL.md
run-device.SKILL.mdname: run-device
description: Build, install, and launch an iOS app on a physical iPhone or iPad entirely from the command line (no Xcode GUI), using xcodebuild + devicectl. Use when the user wants to run, test, or screenshot their app on a real device without opening Xcode.
allowed-tools: [Bash, Read]
last_verified: 2026-07-16
review_by: 2027-06-22
os_version: iOS 27 / macOS 27
Run on a Physical Device (CLI)
Builds, signs, installs, and launches an app on a **connected physical device** straight from the terminal — no Xcode Run button. The companion `run-simulator` skill covers the Simulator; this is the hardware path, which uses a different toolchain: `devicectl` (not `simctl`), real code signing, and an external tool for screenshots.
Building proves the code typechecks and signs; launching proves it installs and runs on real hardware. A crash on launch or a failed install is a failure.
When This Skill Activates
Use when the user wants to:
- Run / test their app on a real iPhone or iPad from the CLI
- Install a build on a device without opening Xcode
- Reproduce a device-only bug (camera, sensors, performance, push)
- Screenshot the app running on hardware
Not for the Simulator (use `run-simulator`) and not for `xcodebuild test`.
Prerequisites (one-time, partly interactive — cannot be scripted)
1. **Device connected** by USB (or paired over Wi-Fi). 2. **Developer Mode ON** (iOS 16+): Settings → Privacy & Security → Developer Mode → on → restart. There is no CLI to enable this. 3. **Device trusted/paired**: the first connection shows "Trust This Computer?" on the device — tap Trust. `devicectl` pairs once trusted. 4. **Automatic signing configured**: the target needs `CODE_SIGN_STYLE = Automatic` and a `DEVELOPMENT_TEAM`, and the signing Apple ID must already be logged into Xcode (Settings → Accounts) so `-allowProvisioningUpdates` can mint profiles. A free personal team works but apps expire after 7 days.
Confirm reachability before building:
xcrun devicectl list devices
The **Identifier** column is a CoreDevice UUID (e.g. `A1B2C3D4-…`). It is used by `devicectl` for install/launch. **It is NOT the value `xcodebuild` wants** — see the trap in step 2. Pick a row whose State is `available (paired)` / `connected`.
Process
1. Pick the device identifier
xcrun devicectl list devices # grab the Identifier (CoreDevice UUID) of the paired device
Store it: `DEV=<identifier-from-the-Identifier-column>`.
2. Build + sign for a device
**Trap:** `xcodebuild` matches on the *hardware* UDID, not the `devicectl` identifier. Passing `-destination 'platform=iOS,id=<devicectl-id>'` fails with *"Unable to find a device matching the provided destination specifier."* Build for a generic device instead — it produces the same signed `.app`:
xcodebuild build \
-project MyApp.xcodeproj -scheme MyApp \
-destination 'generic/platform=iOS' \
-allowProvisioningUpdates 2>&1 | tail -5
(Use `-workspace MyApp.xcworkspace` instead of `-project` if the project has one.) Look for `** BUILD SUCCEEDED **`. `-allowProvisioningUpdates` lets xcodebuild register the device and create/refresh the provisioning profile automatically.
Common failures:
- *"Signing requires a development team"* → set `DEVELOPMENT_TEAM=XXXXXXXXXX` on
the command line, or fix it in project settings.
- *"No profiles for '…' were found"* → add `-allowProvisioningUpdates` (above), and
make sure the signing Apple ID is logged into Xcode.
3. Resolve the built `.app` (device build → `Debug-iphoneos`)
Don't guess DerivedData — read it from build settings. Note the directory is `Debug-iphoneos` for device builds (vs `Debug-iphonesimulator` for the Simulator):
eval $(xcodebuild -project MyApp.xcodeproj -scheme MyApp \
-destination 'generic/platform=iOS' -showBuildSettings 2>/dev/null \
| awk -F' = ' '/ TARGET_BUILD_DIR =/{print "DIR=\""$2"\""} / FULL_PRODUCT_NAME =/{print "NAME=\""$2"\""}')
APP="$DIR/$NAME" # .../Debug-iphoneos/MyApp.app
BID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP/Info.plist")4. Install
xcrun devicectl device install app --device "$DEV" "$APP"
Prints `App installed:` with the `bundleID` and `installationURL` on success.
5. Launch
xcrun devicectl device process launch --device "$DEV" "$BID"
Prints `Launched application with <bundle id> …`.
**Known quirk:** adding `--terminate-existing` (to relaunch a running app) sometimes returns `CoreDeviceError 10004 — "process identifier … could not be determined"` even though the app launched. If you see it, run the **plain** launch above and verify it's actually running:
xcrun devicectl device info processes --device "$DEV" | grep -i MyApp.app
A matching `pid /…/MyApp.app` line confirms it's live.
6. Screenshot (optional — needs an extra tool)
`devicectl` has **no** screenshot command, so device screenshots require [`libimobiledevice`](https://libimobiledevice.org):
brew install libimobiledevice # one-time
idevicescreenshot /tmp/device-shot.png # captures the foreground screen
Then **Read `/tmp/device-shot.png`** and verify the change renders.
Caveats:
- `idevicescreenshot` needs the Developer Disk Image mounted. Running the app via
`devicectl` (steps 4–5) mounts it, so screenshot *after* launching.
- If multiple devices are attached, target one: `idevicescreenshot -u <hardware-udid> …`
(`idevice_id -l` lists hardware UDIDs — again, distinct from the `devicectl` id).
- On a headless/CI box without Homebrew, this step isn't available; fall back to a
manual screenshot on the device.
Output Format
Report:
- Device used (name + identifier) and that it was paired/available
- Build result (`** BUILD SUCCEEDED **` or the `error:` lines, then stop)
- Install result and launch confirmation (pid or the running-process check)
- If screenshotted: read the image back and
Read more
name: run-device description: Build, install, and launch an iOS app on a physical iPhone or iPad entirely from the command line (no Xcode GUI), using xcodebuild + devicectl. Use when the user wants to run, test, or screenshot their app on a real device without opening Xcode. allowed-tools: [Bash, Read] last_verified: 2026-07-16 review_by: 2027-06-22 os_version: iOS 27 / macOS 27
Run on a Physical Device (CLI)
Builds, signs, installs, and launches an app on a **connected physical device** straight from the terminal — no Xcode Run button. The companion `run-simulator` skill covers the Simulator; this is the hardware path, which uses a different toolchain: `devicectl` (not `simctl`), real code signing, and an external tool for screenshots.
Building proves the code typechecks and signs; launching proves it installs and runs on real hardware. A crash on launch or a failed install is a failure.
When This Skill Activates
Use when the user wants to:
- Run / test their app on a real iPhone or iPad from the CLI
- Install a build on a device without opening Xcode
- Reproduce a device-only bug (camera, sensors, performance, push)
- Screenshot the app running on hardware
Not for the Simulator (use `run-simulator`) and not for `xcodebuild test`.
Prerequisites (one-time, partly interactive — cannot be scripted)
1. **Device connected** by USB (or paired over Wi-Fi). 2. **Developer Mode ON** (iOS 16+): Settings → Privacy & Security → Developer Mode → on → restart. There is no CLI to enable this. 3. **Device trusted/paired**: the first connection shows "Trust This Computer?" on the device — tap Trust. `devicectl` pairs once trusted. 4. **Automatic signing configured**: the target needs `CODE_SIGN_STYLE = Automatic` and a `DEVELOPMENT_TEAM`, and the signing Apple ID must already be logged into Xcode (Settings → Accounts) so `-allowProvisioningUpdates` can mint profiles. A free personal team works but apps expire after 7 days.
Confirm reachability before building:
xcrun devicectl list devices
The **Identifier** column is a CoreDevice UUID (e.g. `A1B2C3D4-…`). It is used by `devicectl` for install/launch. **It is NOT the value `xcodebuild` wants** — see the trap in step 2. Pick a row whose State is `available (paired)` / `connected`.
Process
1. Pick the device identifier
xcrun devicectl list devices # grab the Identifier (CoreDevice UUID) of the paired device
Store it: `DEV=<identifier-from-the-Identifier-column>`.
2. Build + sign for a device
**Trap:** `xcodebuild` matches on the *hardware* UDID, not the `devicectl` identifier. Passing `-destination 'platform=iOS,id=<devicectl-id>'` fails with *"Unable to find a device matching the provided destination specifier."* Build for a generic device instead — it produces the same signed `.app`:
xcodebuild build \ -project MyApp.xcodeproj -scheme MyApp \ -destination 'generic/platform=iOS' \ -allowProvisioningUpdates 2>&1 | tail -5
(Use `-workspace MyApp.xcworkspace` instead of `-project` if the project has one.) Look for `** BUILD SUCCEEDED **`. `-allowProvisioningUpdates` lets xcodebuild register the device and create/refresh the provisioning profile automatically.
Common failures:
- *"Signing requires a development team"* → set `DEVELOPMENT_TEAM=XXXXXXXXXX` on
the command line, or fix it in project settings.
- *"No profiles for '…' were found"* → add `-allowProvisioningUpdates` (above), and
make sure the signing Apple ID is logged into Xcode.
3. Resolve the built `.app` (device build → `Debug-iphoneos`)
Don't guess DerivedData — read it from build settings. Note the directory is `Debug-iphoneos` for device builds (vs `Debug-iphonesimulator` for the Simulator):
eval $(xcodebuild -project MyApp.xcodeproj -scheme MyApp \
-destination 'generic/platform=iOS' -showBuildSettings 2>/dev/null \
| awk -F' = ' '/ TARGET_BUILD_DIR =/{print "DIR=\""$2"\""} / FULL_PRODUCT_NAME =/{print "NAME=\""$2"\""}')
APP="$DIR/$NAME" # .../Debug-iphoneos/MyApp.app
BID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP/Info.plist")4. Install
xcrun devicectl device install app --device "$DEV" "$APP"
Prints `App installed:` with the `bundleID` and `installationURL` on success.
5. Launch
xcrun devicectl device process launch --device "$DEV" "$BID"
Prints `Launched application with <bundle id> …`.
**Known quirk:** adding `--terminate-existing` (to relaunch a running app) sometimes returns `CoreDeviceError 10004 — "process identifier … could not be determined"` even though the app launched. If you see it, run the **plain** launch above and verify it's actually running:
xcrun devicectl device info processes --device "$DEV" | grep -i MyApp.app
A matching `pid /…/MyApp.app` line confirms it's live.
6. Screenshot (optional — needs an extra tool)
`devicectl` has **no** screenshot command, so device screenshots require [`libimobiledevice`](https://libimobiledevice.org):
brew install libimobiledevice # one-time idevicescreenshot /tmp/device-shot.png # captures the foreground screen
Then **Read `/tmp/device-shot.png`** and verify the change renders.
Caveats:
- `idevicescreenshot` needs the Developer Disk Image mounted. Running the app via
`devicectl` (steps 4–5) mounts it, so screenshot *after* launching.
- If multiple devices are attached, target one: `idevicescreenshot -u <hardware-udid> …`
(`idevice_id -l` lists hardware UDIDs — again, distinct from the `devicectl` id).
- On a headless/CI box without Homebrew, this step isn't available; fall back to a
manual screenshot on the device.
Output Format
Report:
- Device used (name + identifier) and that it was paired/available
- Build result (`** BUILD SUCCEEDED **` or the `error:` lines, then stop)
- Install result and launch confirmation (pid or the running-process check)
- If screenshotted: read the image back and
A collection of Claude Code skills for iOS, macOS, watchOS, visionOS, and Apple platform development. These skills help you plan and build apps, maintain code quality, ensure HIG compliance, and guide you from idea to App Store.
Repo: rshankras/claude-code-apple-skills
Other skills on rshankras-apple-skills.
- /app-store
App Store optimization and marketing skills for descriptions, screenshots, keywords, review responses, and comprehensive promotional strategy. Use when user needs help with App Store presence, ASO, marketing, or customer communication.
Open skill - /ad-attribution
Privacy-preserving ad measurement with AdAttributionKit (SKAdNetwork's successor) — install and re-engagement attribution, conversion-value strategy under crowd anonymity, and end-to-end postback testing. Use when running paid acquisition beyond Apple Ads, measuring
Open skill - /app-description-writer
Generate compelling App Store descriptions that convert browsers into users. Use when writing initial descriptions, improving existing copy, or drafting promotional text and What's New for a major update.
Open skill - /apple-search-ads
Apple Search Ads campaign strategy for indie developers — paid acquisition, keyword bidding, budget planning, and ROAS optimization. Use when user asks about running ads, paid user acquisition, or Apple Search Ads campaigns.
Open skill - /iap-finalizer
Take a one-time in-app purchase from MISSING_METADATA to READY_TO_SUBMIT in App Store Connect — set its price schedule and localized display name/description (and optional review screenshot) via the ASC REST API. Use at Phase 6 (Pre-Release), after the IAP is built in-app (Phase
Open skill - /keyword-optimizer
Optimize app title, subtitle, and keywords for maximum App Store discoverability. Use when launching a new app, improving search rankings, entering new markets/languages, or safely optimizing ASO for an app with existing traffic.
Open skill

