Tutorial by Examples

To run your unit tests in the simulator using xcodebuild use If you have a workspace (e.g. when using CocoaPods) xcodebuild \ -workspace MyApp.xcworkspace \ -scheme "MyScheme" \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.1' \ test If ...
To list all available schemes for the project in your current directory xcodebuild -list Optionally you can pass a path to a project or workspace file xcodebuild -list -workspace ./MyApp.xcworkspace xcodebuild -list -project ./MyApp.xcodeproj Example output Information about project "...
Cleaning and compiling code for iPhone, on project MyProject for schema Qa: xcrun xcodebuild clean \ -workspace "MyProject.xcworkspace" \ -scheme "YourScheme" \ -sdk iphoneos \ -configuration Debug \ archive \ -archivePath builds/MyProject.xcarchive...
xcrun uses the system default Xcode version (set via xcode-select) to locate and execute command line tools from the Xcode application bundle, e.g., llvm-cov. # Generate code coverage reports via llvm-cov # /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin xc...
Print the path to the active developer directory (selected Xcode) xcode-select -p Select a different version of Xcode, e.g. Beta sudo xcode-select -s /Applications/Xcode-beta.app Reset to the default version of Xcode sudo xcode-select -r This is equivalent to running sudo xcode-select -s /Appl...

Page 1 of 1