iOS Dev from the Command Line

  • In general, use xcodebuild for things you’d use XCode for, using an invocation like:
    $ xcodebuild -workspace path/to/workspace \
                 -scheme '<SCHEME>' \
                 -configuration '<Debug|Release>' \
                 -sdk iphonesimulator \ 
  • Use -project/-target instead of -workspace/-scheme.
  • The iphonesimulator SDK uses the newest simulator available. Alternately use iphoneos to use a physical device or run this to list all SDKs:
    $ xcodebuild -showsdks
  • The final argument to xcodebuild is the action to be taken, which needs to be one of:
    • build
    • build
    • analyze
    • archive
    • test
    • test
    • installsrc
    • install
    • clean