Open bartekpacia opened 8 months ago
List installed apps:
xcrun simctl listapps booted | grep CFBundleIdentifier \
| sed 's/[ \t]*$//; s/"//g; s/;//g' \
| cut -d '=' -f 2 | \
xargs -I {} echo {}
Install an app:
xcrun simctl install booted build/ios/iphonesimulator/Runner.app
List simulators:
xcrun simctl list devices booted
List simulators (only names):
xcrun simctl list --json devices available | jq -r '.devices | ."com.apple.CoreSimulator.SimRuntime.iOS-17-5" | .[] .name'
List simulators (only names and udids):
xcrun simctl list --json devices available | jq -r '.devices | ."com.apple.CoreSimulator.SimRuntime.iOS-17-5" | .[] | { "udid": .udid, "name": .name }'
Landmarks app uses SwiftUI.
xcodebuild build \
-project Landmarks.xcodeproj \
-scheme Landmarks \
-configuration Debug \
-sdk iphonesimulator \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath 'derivedData' \
-resultBundlePath "resultBundle/$(date +%s)" \
| xcbeautify
xcodebuild build-for-testing \
-project Landmarks.xcodeproj \
-scheme Landmarks \
-configuration Debug \
-sdk iphonesimulator \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath 'derivedData' \
-resultBundlePath "resultBundle/$(date +%s)" \
| xcbeautify
xcodebuild test-without-building \
-xctestrun derivedData/Build/Products/Landmarks_TestPlan_iphonesimulator17.*-arm64-x86_64.xctestrun \
-only-testing 'LandmarksUITests/LandmarksUITests' \
-destination 'platform=iOS Simulator,name=iPhone 15' \
-resultBundlePath "resultBundle/ios_results_$(date +%s).xcresult"
man xcodebuild.xctestrun
man xcresulttool
(learned about it from https://keith.github.io/xcode-man-pages)xcodebuild -enumerateTests
xcodebuild -showdestinations