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?
Navigate to your project's settings. Under iOS (or the target you want to build your app for) > Identity, you'll want to increment the Build number. For example, if the Build number was 1, you'll want to set it to 2. Then, in the top menu, under Product, click on Archive.
Open the Archives folder in Finder: Library > Developer > Xcode > Archives.
Open Xcode and select Open Another Project or File, Open. Open the folder you unzipped from your Dropsource download and locate the file with “. xcodeproj” extension in the root directory. Select the file and click Open.
In the Archives organizer, select the archive, then click Distribute App. In the next sheet, select a distribution method based on your app's platform. To distribute to a limited number of users on registered devices only—for example, distribute within your organization—choose Ad Hoc or Development.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With