Setting a provisioning profile from within xcodebuild when making iPhone apps

Actually, you should be able to just add it to the XCode command line setting. xcodebuild [whatever other options you have] PROVISIONING_PROFILE=”[Your profile Unique ID here]” Build Settings from the command line are supposed to override everything, so this should win out over anything defined in the project or target.

xcodebuild -exportArchive: exportOptionsPlist error for key ‘method’: expected one of {}

I suspected xcodebuild tool initially, but it turned out the archive file was invaid. When I opened the archive file in Xcode and tried to export an ipa file manually, I noticed that “Upload to App Store” and “Validate” buttons were disabled. After clicking the “Export” button, it gave me two options: “Save Built Products” … Read more

No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=armv7 armv7s)

You can set the “Build Active Architecture Only” and “Archs” values from command line itself. We set ARCHS=”armv7 armv7s” ONLY_ACTIVE_ARCH=NO. Eg /usr/bin/xcodebuild ARCHS=”armv7 armv7s” ONLY_ACTIVE_ARCH=NO -workspace -scheme …… This will free you from manually changing the values in your project settings.

Can an Xcode .mobileprovision file be ‘installed’ from the command line?

If you don’t want to download external dependencies (like Ben did), the following should work in most cases: uuid=`grep UUID -A1 -a adhoc.mobileprovision | grep -io “[-A-F0-9]\{36\}”` cp adhoc.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision Note that a UUID is composed of hexadecimal digits so the correct range is [-A-F0-9] and not [-A-Z0-9]. Bonus: Download and install profiles Using … Read more