Xcodebuild -Exportarchive Wont Allow Me to Specify Filename

xcodebuild - how to specify the directory where the project is, without doing a cd in it

You must be in the directory containing the project(s) when you run xcodebuild. If you don’t want to mess with your current directory, there a couple of options:

/bin/sh -c "cd $PRJDIR; xcodebuild"

or

(cd $PRJDIR; xcodebuild)

xcodebuild -exportArchive options plist values for thinning

It is absolutely literally <string><none></string>

In Xcode 7, here is a list of all options:

{<none>, <thin-for-all-variants>, iPad3,1, iPad3,2, iPad3,3, iPad3,4, iPad3,5, iPad3,6, iPad2,3, iPad2,1, iPad2,4, iPad2,2, iPad4,1, iPad4,2, iPad4,3, iPad5,3, iPad5,4, iPad6,7, iPad6,8, iPad6,3, iPad6,4, iPad2,5, iPad2,6, iPad2,7, iPad4,4, iPad4,5, iPad4,6, iPad4,7, iPad4,8, iPad4,9, iPad5,1, iPad5,2, iPhone4,1, iPhone5,1, iPhone5,2, iPhone5,3, iPhone5,4, iPhone6,1, iPhone6,2, iPhone7,2, iPhone7,1, iPhone8,1, iPhone8,2, iPhone8,4, iPod5,1, iPod7,1}

Generate xcarchive into a specific folder from the command line

My current solution is to rename the user's existing archives folder, run the build, and do a 'find' to copy the archives where i want, then delete the archives folder and rename the old folder back as it was, with code like this in my ruby build script:

# Move the existing archives out of the way
system('mv ~/Library/Developer/Xcode/Archives ~/Library/Developer/Xcode/OldArchivesTemp')
# Build the .app, the .DSYM, and the .xcarchive
system("xcodebuild -scheme \"#{scheme}\" clean build archive CONFIGURATION_BUILD_DIR=\"#{build_destination_folder}\"")
# Find the xcarchive wherever it was placed and copy it where i want it
system("find ~/Library/Developer/Xcode/Archives -name *.xcarchive -exec cp -r {} \"#{build_destination_folder}\" \";\"")
# Delete the new archives folder with this new xcarchive
system('rm -rf ~/Library/Developer/Xcode/Archives')
# Put the old archives back
system('mv ~/Library/Developer/Xcode/OldArchivesTemp ~/Library/Developer/Xcode/Archives')

Its a bit hacky but i don't see a better solution currently. At least it preserves the user's 'archives' folder and all their pre-existing archives.

--Important note!--

I since found out that the line of code where i find the archive and cp it to the folder i want doesn't copy the symlinks inside the archive correctly, thus breaking the code signing in the app. You'll want to replace that with a 'mv' or something that maintains symlinks. Cheers!

Xcode attempted to locate or generate matching signing assets and failed to do so

I'm also facing this issue as a 'Team Member' role. The 'You are not allowed to perform this operation' warning leads me to believe that XCode is more strictly enforcing the roles defined here: https://developer.apple.com/programs/roles/

Even though I have access to the signing assets (certificate and provisioning profile), XCode won't allow me to specify them. Try upgrading your role to Team Admin.

Updated 2014-09-29:
After extensive research, I've found it is possible to generate the .ipa using xcodebuild from the command line even as a 'Team Member' role using the following:

xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile "Provisioning Profile Name"

credit to 1

Note: As pointed out in the linked article, the "Provisioning Profile Name" is the name specified in the name field of the certificate (viewable from developer.apple.com).

You can automate the process in xcode by including the call into your project build script.



Related Topics



Leave a reply



Submit