Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Archive Build iOS App with XCode Open

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?

like image 363
aherrick Avatar asked Apr 05 '15 14:04

aherrick


People also ask

How do I archive a build in Xcode?

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.

How do I open an archive window in Xcode?

Open the Archives folder in Finder: Library > Developer > Xcode > Archives.

How do I open an existing app in Xcode?

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.

How do I distribute an archive in Xcode?

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.


1 Answers

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
like image 150
weltschraet Avatar answered Oct 08 '22 03:10

weltschraet