| name | appledev-cli |
| description | Reference for the AppleDev.Tools CLI (`apple` command) - a .NET global tool for Apple development automation. Use when: (1) Managing iOS/macOS simulators (list, create, boot, screenshot, install apps), (2) Working with App Store Connect (certificates, profiles, bundle IDs, devices), (3) Setting up CI/CD for Apple development (provision, deprovision, keychain management), (4) Uploading apps to TestFlight/App Store Connect, (5) Parsing or managing provisioning profiles locally. Covers all commands, options, and common workflows.
|
AppleDev.Tools CLI Reference
Installation
dotnet tool install -g AppleDev.Tool
The tool installs as the apple command.
Authentication for App Store Connect Commands
Commands that interact with App Store Connect require authentication via environment variables or command options:
export APP_STORE_CONNECT_KEY_ID="ABC123DEF4"
export APP_STORE_CONNECT_ISSUER_ID="12345678-1234-1234-1234-123456789012"
export APP_STORE_CONNECT_PRIVATE_KEY="$(cat ~/AuthKey_ABC123DEF4.p8)"
apple provisioning list \
--key-id ABC123DEF4 \
--issuer-id 12345678-1234-1234-1234-123456789012 \
--private-key ~/AuthKey_ABC123DEF4.p8
Output Formats
Most commands support --format option:
None (default) - Human-readable table
json - JSON output for scripting
--verbose - Additional details
Simulator Commands
Manage iOS, watchOS, tvOS, and visionOS simulators.
List Simulators
apple simulator list
apple simulator list --booted
apple simulator list --available
apple simulator list --name "My iPhone 15"
apple simulator list --device-type "iPhone 16 Pro"
apple simulator list --runtime "iOS 18.3"
apple simulator list --product-family "iPhone"
apple simulator list --format json
Create Simulator
apple simulator create "My iPhone 15" --device-type "iPhone 15"
apple simulator create "My iPhone 15 Pro" --device-type "iPhone 15 Pro" --runtime "iOS 17.0"
apple simulator create "Apple Watch Series 9" --device-type "Apple Watch Series 9 (45mm)" --runtime "watchOS 10.0"
Boot / Shutdown / Erase / Delete
apple simulator boot "My iPhone 15"
apple simulator boot --wait "My iPhone 15"
apple simulator boot --wait --timeout 180 <udid>
apple simulator shutdown "My iPhone 15"
apple simulator shutdown booted
apple simulator shutdown all
apple simulator erase "My iPhone 15"
apple simulator erase all
apple simulator delete "My Old iPhone"
apple simulator delete unavailable
Screenshots
apple simulator screenshot booted
apple simulator screenshot "My iPhone 15" --output ~/Desktop/screenshot.png
App Management
apple simulator app install booted ~/MyApp.app
apple simulator app uninstall booted com.mycompany.myapp
apple simulator app launch booted com.mycompany.myapp
apple simulator app terminate booted com.mycompany.myapp
apple simulator app list booted
Other Simulator Commands
apple simulator open
apple simulator open <udid>
apple simulator device-types
apple simulator open-url booted "myapp://deeplink"
apple simulator logs booted
apple simulator logs booted --predicate "eventMessage contains 'error'"
App Store Connect Commands
Certificates
apple certificate list
apple certificate list --type IOS_DISTRIBUTION
apple certificate list --format json
apple certificate create
apple certificate create --type DISTRIBUTION --output ~/certs/
apple certificate create --type IOS_DISTRIBUTION --common-name "My Cert"
apple certificate revoke <cert-id>
Certificate Types: DEVELOPMENT, DISTRIBUTION, IOS_DEVELOPMENT, IOS_DISTRIBUTION, MAC_APP_DEVELOPMENT, MAC_APP_DISTRIBUTION, DEVELOPER_ID_APPLICATION
Bundle IDs
apple bundleids list
apple bundleids list --platform IOS
apple bundleids list --identifier com.mycompany.*
apple bundleids create "My App" com.mycompany.myapp IOS
apple bundleids create "Mac App" com.mycompany.macapp MAC_OS
apple bundleids create "Universal App" com.mycompany.app UNIVERSAL
apple bundleids create "Wildcard" "com.mycompany.*" IOS
apple bundleids update <id> --name "New Name"
apple bundleids delete <id>
Platforms: IOS, MAC_OS, UNIVERSAL
Registered Devices
apple devices list
apple devices list --platform IOS
apple devices list --status ENABLED
apple devices register "John's iPhone" 00008030-001234567890001E IOS
apple devices register "Test Mac" 12345678-1234-1234-1234-123456789012 MAC_OS
apple devices update <id> --name "John's New iPhone"
apple devices update <id> --status DISABLED
Provisioning Profiles
apple provisioning list
apple provisioning list --type IOS_APP_DEVELOPMENT
apple provisioning list --bundle-id com.mycompany.myapp
apple provisioning list --download
apple provisioning list --install
apple provisioning installed
apple provisioning parse MyApp.mobileprovision
apple provisioning parse ~/Downloads/profile.mobileprovision --format json
apple provisioning create \
--name "My App Dev Profile" \
--type IOS_APP_DEVELOPMENT \
--bundle-id <bundle-id-resource-id> \
--certificates <cert-id> \
--devices <device-id1>,<device-id2>
apple provisioning create \
--name "My App Store Profile" \
--type IOS_APP_STORE \
--bundle-id <bundle-id-resource-id> \
--certificates <cert-id> \
--download
apple provisioning delete <profile-id>
Profile Types: IOS_APP_DEVELOPMENT, IOS_APP_STORE, IOS_APP_ADHOC, IOS_APP_INHOUSE, MAC_APP_DEVELOPMENT, MAC_APP_STORE, MAC_APP_DIRECT
CI/CD Commands
ci provision (Full CI Setup)
Sets up keychain, imports certificate, and downloads provisioning profiles in one command:
apple ci provision \
--certificate IOS_CERT_BASE64 \
--bundle-identifier com.mycompany.myapp
apple ci provision \
--certificate IOS_CERT_BASE64 \
--certificate-passphrase "$CERT_PASSWORD" \
--keychain ci-build.keychain \
--keychain-password temp1234 \
--bundle-identifier com.mycompany.myapp \
--profile-type IOS_APP_STORE \
--api-key-id "$APP_STORE_CONNECT_KEY_ID" \
--api-issuer-id "$APP_STORE_CONNECT_ISSUER_ID" \
--api-private-key "$APP_STORE_CONNECT_PRIVATE_KEY"
ci deprovision (Cleanup)
apple ci deprovision --keychain ci-build.keychain
apple ci deprovision
ci secret (Convert to Base64)
Convert certificates/keys to base64 for secure CI storage:
apple ci secret --from-certificate ios-distribution.p12
apple ci secret --from-private-key AuthKey_ABC123DEF4.p8
apple ci secret --from-certificate cert.p12 --output-file cert.b64
ci base64-to-file / env-to-file
apple ci base64-to-file --base64 IOS_CERT_BASE64 --output-file distribution.p12
apple ci env-to-file --env-var APP_STORE_CONNECT_API_KEY --output-file AuthKey.p8
Keychain Commands
For manual keychain management on macOS:
apple keychain create --keychain ci-temp.keychain-db --password temp1234
apple keychain unlock --keychain ci-temp.keychain-db --password temp1234
apple keychain unlock --allow-any-app-read --keychain ci-temp.keychain-db --password temp1234
apple keychain import distribution.p12 --keychain ci-temp.keychain-db --passphrase certpass
apple keychain import dev.p12 --keychain ci-temp.keychain-db --allow-any-app-read
apple keychain default --keychain ci-temp.keychain-db
apple keychain delete --keychain ci-temp.keychain-db
Xcode & Device Commands
apple xcode list
apple xcode list --format json
apple xcode locate
apple xcode locate --best
apple device list
apple device list --format json
App Upload & Validation
apple validate ~/MyApp.ipa --type ios
apple validate ~/MyApp.app --type macos
apple upload ~/MyApp.ipa --type ios
apple upload ~/MyApp.app --type macos
apple upload ~/MyApp.ipa --type ios \
--key-id ABC123DEF4 \
--issuer-id 12345678-1234-1234-1234-123456789012 \
--private-key ~/AuthKey.p8
App Types: ios, macos, watchos, tvos
App Info
Read Info.plist metadata from an app bundle:
apple app-info ~/MyApp.app
apple app-info ~/MyApp.app --format json
apple app-info ~/MyApp.app --verbose
Common Workflows
CI Setup for iOS App
apple ci secret --from-certificate distribution.p12
apple ci provision \
--certificate "$IOS_CERT_BASE64" \
--certificate-passphrase "$CERT_PASSWORD" \
--bundle-identifier com.mycompany.myapp \
--keychain ci-build.keychain
xcodebuild ...
apple upload output/MyApp.ipa --type ios
apple ci deprovision --keychain ci-build.keychain
Create New App Setup
apple bundleids create "My New App" com.mycompany.newapp IOS
apple provisioning create \
--name "My New App Development" \
--type IOS_APP_DEVELOPMENT \
--bundle-id <bundle-id-from-step-1> \
--certificates <your-cert-id> \
--all-devices \
--download
apple provisioning list --bundle-id com.mycompany.newapp --install
Test on Multiple Simulators
apple simulator create "Test iPhone 15" --device-type "iPhone 15"
apple simulator create "Test iPhone SE" --device-type "iPhone SE (3rd generation)"
apple simulator boot "Test iPhone 15"
apple simulator boot "Test iPhone SE"
apple simulator app install "Test iPhone 15" ~/MyApp.app
apple simulator app install "Test iPhone SE" ~/MyApp.app
apple simulator screenshot "Test iPhone 15" --output iphone15.png
apple simulator screenshot "Test iPhone SE" --output iphonese.png
apple simulator delete "Test iPhone 15"
apple simulator delete "Test iPhone SE"