xcodebuild
# xcodebuild
# xcodebuild test
# xcodebuild test -scheme SCHEME -destination DESTINATION
# xcodebuild test -scheme SCHEME -destination platform=iOS,name=DEVICE_NAME # xcodebuild test -scheme SCHEME -destination platform=iOS,id=SOME_DEVICE_UUID # xcodebuild test -scheme SCHEME -destination platform=macOS,arch=x86_64
# xcodebuild test -scheme SCHEME -destination "platform=iOS Simulator,id=SIMULATOR_ID" # xcodebuild test -scheme SCHEME -destination "platform=iOS Simulator,name=iPhone SE,OS=12.0"
# xcodebuild test ... -workspace WORKSPACE
# xcodebuild build-for-testing # xcodebuild test-without-building
# xcodebuild archive -workspace WORKSPACE -scheme SCHEME -sdk iphoneos -configuration AppStoreDistribution -destination DESTINATION -archivePath $PWD/build/archive.xcarchive
# xcodebuild -exportArchive -archivePath $PWD/build/archive.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build
... <key>method</key> <string>app-store</string> <key>teamID</key> <string>YOUR_TEN_CHARACTER_TEAM_ID</string> ...
# xcrun altool --upload-app -f MyApp.ipa -u MY_USERNAME -p MY_PASSWORD
Print the current Xcode:
# xcode-select -p
Set another:
# xcode-select --s /Path/To/Xcode.app/Contents/Developer
Simulators
xcrun simctl list devices
Device types
xcrun simctl list devicetypes
Runtimes
xcrun simctl list runtimes
# xcrun simctl create DevWorld com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-0
Install it
# xcrun simctl install SIMULATOR_ID /path/to/Your.app
And launch it
# xcrun simctl launch SIMULATOR_ID com.your.app
xcrun simctl openurl SIMULATOR_ID x-your-app://
func testRunner() { var dt = Date(timeIntervalSinceNow: 0.1) while true { RunLoop.current.run(mode: .default, before: dt) dt = Date(timeIntervalSinceNow: 0.1) } }
# xcodebuild build GCC_PREPROCESSOR_DEFINITIONS="MY_MACRO=@\"AWESOME\""
// and in objective-c: -(void)awesomeFunction { NSLog(MY_MACRO); }
# xcodebuild ... OTHER_SWIFT_FLAGS="-D’COOL_FLAG’"
// your swift code ... #if COOL_FLAG print(“WE Are Cool”) #endif ...
# xcodebuild DEVELOPMENT_TEAM=...
xcodebuild --keychain $PATH_TO_KEYCHAIN
# security -v list-keychain -s path/to/keychain
# security -v unlock-keychain -p $PASSWORD path/to/keychain
# security -v set-chain-settings -t $TIMEOUT -l path/to/keychain
www.libimobiledevice.org
# idevice_id -l d840b2e7fa04f99e0ee780d007433669b8bf9e87
# ideviceinfo -u $UUID -x -s
thepatrick.io/talks.html