Tuesday, October 29, 2013

Building iOS apps for Simulator with Xcode 5 with command line

Things a little changed since Xcode 4

If you want to build your project for simulator 
and want to do it with the latest and the greatest version of Xcode - version 5.x
and want to do it with command line utility xcodebuild, 
because you need this for Continuous Integration or someth, 
then: 

1. In your Build Scheme for Simulator in project's "Build Settings" in section "Code Signing" set:
  • "Don't Code Sign" for "Code Signing Identity"
  • "None" for "Provisioning Profile"
2. In command line use iphonesimulator7.0 as desired SDK
(even if you have downloaded SDK 6.1, it won't help. not without other voodoo dark magic)

/usr/bin/xcodebuild -verbose \
  -project MyCoolProject/MyCoolProject.xcodeproj \
  -scheme MyCoolProjectSimulator \
  -configuration Debug \
  -arch i386 \
  -sdk iphonesimulator7.0 \
  TARGETED_DEVICE_FAMILY=2 \
  clean build

where TARGETED_DEVICE_FAMILY is iPhone (1) or iPad (2)


No comments:

Post a Comment