7

I am currently able to adhoc build my iOS app using the following command:

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration AdHoc archive -archivePath /Users/andrewherrick/Desktop/MyApp.xcarchive

It works great when my phone isn't connected to my Mac having XCode recognize it. However, when it's plugged in it always bombs out:

Reason: You cannot archive for the iOS Simulator platform.

Is there anyway I can modify the build command to allow me to NOT have to disconnect my phone everytime I want a fresh adhoc build?

aherrick
  • 19,799
  • 33
  • 112
  • 188

1 Answers1

12

try using the -destination parameter. e.g.:

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration AdHoc archive -archivePath /Users/andrewherrick/Desktop/MyApp.xcarchive -destination generic/platform=iOS
weltschraet
  • 121
  • 3