I am trying to continuous integrate for an Enterprise IOS Build for AdhocProd. Using below command for Build and Archive .
Build Command:
/usr/bin/xcodebuild -workspace "Project.xcworkspace" -scheme
"ProjectiOSPROD" -archivePath build/ProjectiOS -configuration Release
archive CODE_SIGN_STYLE=Manual
PROVISIONING_PROFILE=”CompanyNameProdAdhocDistribution”
CODE_SIGNING_IDENTITY="iPhone Developer: Build Machine(XXXXXX)"
PRODUCT_BUNDLE_IDENTIFIER="com.Companyname.prod.ProjectiOS"
OUTPUT:
** ARCHIVE SUCCEEDED **
Export Command:
/usr/bin/xcodebuild -exportArchive -archivePath "build/ProjectiOS.xcarchive" -exportPath "build/ProjectiOS.ipa" -exportOptionsPlist"../../ExportOptions.plist"
This Plist is ExportOptions.Plist taken from the xcode IDE. and using it for jenkins work space
Output:
error: exportArchive: SDWebImage.framework does not support provisioning profiles.
Error Domain=IDEProvisioningErrorDomain Code=10 "SDWebImage.framework does not support provisioning profiles." UserInfo={NSLocalizedDescription=SDWebImage.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=SDWebImage.framework does not support provisioning profiles, but provisioning profile CompanyNameProdAdhocDistribution has been manually specified. Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.}
error: exportArchive: Stripe.framework does not support provisioning profiles.
Error Domain=IDEProvisioningErrorDomain Code=10 "Stripe.framework does not support provisioning profiles." UserInfo={NSLocalizedDescription=Stripe.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=Stripe.framework does not support provisioning profiles, but provisioning profile CompanyNameProdAdhocDistribution has been manually specified. Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.}
provisioningProfiles dictionary is already present in Property list. If i removed this it says add this to Property list.
Any Suggestions would be greatly Appreciated.
You have to generate and export the IPA manually with Xcode9.2. This will create a file name ExportOptions.plist in the exported folder.
Copy that file to workspace root folder.
Write below command in Execute shell.
xcodebuild -exportArchive -archivePath ${WORKSPACE}/build/YourProject.xcarchive -exportPath ${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_NUMBER}/archive -exportOptionsPlist ${WORKSPACE}/ExportOptions.plist
Related
The ARCHIVE Process is always successful, but not the EXPORT process.
Here is the thing, when the export type is development, it always success.
But when I change the export type to app-store, it went wrong.
And here is the error message.
10:01:52 ** ARCHIVE SUCCEEDED **
10:01:52
10:01:52 Cleaning up previously generated .ipa files
10:01:52 Cleaning up previously generated .dSYM.zip files
10:01:52 Packaging IPA
10:01:52 [XCodeProj] $ /usr/libexec/PlistBuddy -c "Print :ApplicationProperties:CFBundleVersion" /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Release-iphoneos/Unity-iPhone.xcarchive/Info.plist
10:01:52 [XCodeProj] $ /usr/libexec/PlistBuddy -c "Print :ApplicationProperties:CFBundleShortVersionString" /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Release-iphoneos/Unity-iPhone.xcarchive/Info.plist
10:01:52 Packaging Unity-iPhone.xcarchive => /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts/jenkins-Release-app-store-364.ipa
10:01:52 [XCodeProj] $ /usr/bin/xcodebuild -exportArchive -archivePath /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Release-iphoneos/Unity-iPhone.xcarchive -exportPath /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts -exportOptionsPlist /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts/app-store2477P575MMExport.plist
10:01:52 2018-01-09 10:01:52.598 xcodebuild[3570:174459] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/2w/320q_j1s5x10tmvq2rmwgx3c000086/T/Unity-iPhone_2018-01-09_10-01-52.597.xcdistributionlogs'.
10:01:53 2018-01-09 10:01:53.800 xcodebuild[3570:174459] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f89ce77b200>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
10:01:53 "Error Domain=IDEProfileLocatorErrorDomain Code=1 \"No profiles for 'com.pantheon.artopia' were found\" UserInfo={NSLocalizedDescription=No profiles for 'com.pantheon.artopia' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.pantheon.artopia'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}"
10:01:53 )}
10:01:53 error: exportArchive: No profiles for 'com.pantheon.artopia' were found
10:01:53
10:01:53 Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.pantheon.artopia' were found" UserInfo={NSLocalizedDescription=No profiles for 'com.pantheon.artopia' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.pantheon.artopia'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}
10:01:53
10:01:53 ** EXPORT FAILED **
The error message said that I don't have a proper provision profile for my app.
But I just make two app-store distribution profile for my app, one for com.pantheon.artopia, and one for wildcard.
And I actually download them and copy them to jenkins's provision profiles folder.
It also suggest to put -allowProvisioningUpdates to xcodebuild, and I actually did it.
But the bas thing is -allowProvisioningUpdates only passed to the archive step, but not to the export step.
So how could I solve this, I need your suggestions.
My jenkins settings are:
In the "General build settings" of the Xcode Plugin, just deselect step "Pack application, build and sign .ipa?", and add one "Execute Shell" step.
The shell script is simple:
/usr/bin/xcodebuild -exportArchive -archivePath "/Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Debug-iphoneos/Unity-iPhone.xcarchive" -exportPath "/Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts" -exportOptionsPlist "/Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/exportoptions/ExportOptions-"${ExportType}".plist" -allowProvisioningUpdates
The only thing you should provide is exportoptions.plist, which you can find one in your own Xcode Export directory.
You can find more information in https://github.com/fastlane/fastlane/issues/9589
I have to start by saying if I build using Xcode, everything is fine. My goal is to use xcodebuild with Jenkins so that I can have automated builds with multiple environments. I am really confused with how Xcode 8 works with automated signing.
I started by looking at this: Use xcodebuild (Xcode 8) and automatic signing in CI (Travis/Jenkins) environments
Things started to work when I did this. However, now when I added a new bundle ID and PP, I started to get the following errors. Also, the previous build ID doesn't work either:
Building
23:06:50 Check dependencies
23:06:50 [BCEROR]No profiles for 'com.x.y.z' were found: Xcode couldn't find a provisioning profile matching 'com.x.y.z'.
23:06:50 [BCEROR]Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Archiving
23:06:51 No profiles for 'com.x.y.z' were found: Xcode couldn't find a provisioning profile matching 'com.x.y.z'.
23:06:51 Code signing is required for product type 'Application' in SDK 'iOS 10.3'
23:06:51 ** ARCHIVE FAILED **
This is what I am doing:
#if the directory exist, run the command
if [ -d "~/Library/Developer/Xcode/DerivedData" ]; then
xattr -rc ~/Library/Developer/Xcode/DerivedData
fi
#Unlock keychain
security unlock-keychain -p xxx ~/Library/Keychains/login.keychain
#Build .xarchive
xcodebuild -project ${WORKSPACE}/PATH.xcodeproj \
-scheme X \
-configuration Release \
clean \
archive -archivePath ${WORKSPACE}/.../archive.xcarchive \
DEVELOPMENT_TEAM=XXX
#Unlock keychain
security unlock-keychain -p x ~/Library/Keychains/login.keychain
#Exporting to .ipa
xcodebuild -exportArchive -archivePath ${WORKSPACE}/XXX/archive.xcarchive \
-exportOptionsPlist /XXXX/exportOptions.plist \
-exportPath ${WORKSPACE}/XXXX/Output/${Environment} \
PROVISIONING_PROFILE_SPECIFIER="ENVIRONMENT_PP"
So I am using Unity to generate the xcode project. What I did to fix it:
In Unity, disable the automatic signing and specify the Provisioning profile hash, (I got the hash from using the editor view, and copied the value to the script):
private static readonly string UDIDProfileHash = "HASH";
PlayerSettings.iOS.appleEnableAutomaticSigning = false;
PlayerSettings.iOS.appleDeveloperTeamID = "TEAMID";
PlayerSettings.iOS.iOSManualProvisioningProfileID = UDIDProfileHash;
For the Xcodebuild syntax I removed specifying the Provisioning profile:
PROVISIONING_PROFILE_SPECIFIER="ENVIRONMENT_PP"
I want to make build scripts for my app to export xcarchive and ipa files.
I used following command to export xcarchive:
xcodebuild -scheme myscheme archive -archivePath path/appname.xcarchive
Which gave me an xcarchive file and I used following to export IPA file:
xcodebuild -exportArchive -exportFormat IPA -exportProvisioningProfile *** -archivePath path/appname.xcarchive -exportPath path/appname.ipa
And I got following error regardless of what I typed in front of exportProvisioningProfile.
no provisioning profile matches ***
** EXPORT FAILED **
What should I write insted of *** in front of exportProvisioningProfile?
The name of the provisioning profile. This is the same name as seen on the page (https://developer.apple.com/account/ios/profile/profileList.action). If you have spaces in that name you need to write the name with quotes. E.g.
xcodebuild -exportArchive -exportFormat IPA -archivePath
MyMobileApp.xcarchive -exportPath MyMobileApp.ipa
-exportProvisioningProfile 'MyMobileApp Distribution Profile'
It may also be that you have not downloaded the provisioning profile, try re-downloading it and opening it with Xcode to install it in the correct location.
I am trying to create ipa of my application using terminal.
I am able to successfully build my application, but when converting into an ipa, it throws the following error:
Check dependencies
Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “/Users/xxxx/Downloads/Certificate/xxxx.mobileprovision”, however, no such provisioning profile was found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'
** ARCHIVE FAILED **
When I try to build the same application using X-Code, it works fine with the same provisioning profile.
The script I am running to build the ipa is
xcodebuild -verbose -project Build_Project_From_Terminal.xcodeproj -scheme nameOfProject -configuration Release -sdk iphoneos clean archive CONFIGURATION_BUILD_DIR="/Users/xxxx/Desktop/xxxx/Project Name/build" PROVISIONING_PROFILE="/Users/xxxxx/Downloads/Certificate/xxxxx.mobileprovision"
EDIT 1:
I have changed my script to
DEVELOPER_NAME="xxxxxxxxx" APP_NAME="xxxxxx"
xcodebuild archive -project $APP_NAME.xcodeproj -scheme $APP_NAME -archivePath ./$APP_NAME.xcarchive
xcodebuild -exportArchive -exportFormat APP -archivePath ./$APP_NAME.xcarchive -exportPath ./$APP_NAME.ipa
iphoneos PackageApplication -v ./$APP_NAME.app -o ./$APP_NAME.ipa --sign $DEVELOPER_NAME --embed ./*.mobileprovision
With this I am getting $APP_NAME.ipa.app as output. When I try to install this, it does not install at all.
Any help will be appreciated.
Please use an alternate method. This is a working example
DEVELOPER_NAME="Your apple developer name"
APP_NAME="application name"
xcodebuild archive -workspace $APP_NAME.xcworkspace -scheme $APP_NAME -archivePath ./$APP_NAME.xcarchive
xcodebuild -exportArchive -exportFormat APP -archivePath ./$APP_NAME.xcarchive -exportPath ./$APP_NAME.ipa
iphoneos PackageApplication -v ./$APP_NAME.app -o ./$APP_NAME.ipa --sign $DEVELOPER_NAME --embed ./*.mobileprovision
Save above shell script in a file (abc.sh) and save that file in your project folder along with your provision profile. Run this script using terminal will save ipa in the project directory.
I use to automate the build of my Adhoc and Distrib release of my apps with a simple script:
echo "***** xcodebuild: compile project"
xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Release CONFIGURATION_BUILD_DIR="${PROJECT_BUILDDIR}"
echo "***** xcrun Package app (ipa file) - Adhoc release"
/usr/bin/xcrun -sdk iphoneos PackageApplication "${PROJECT_BUILDDIR}/${PROJECT_NAME}.app" -o
"${PROJECT_BUILDDIR}/${PROJECT_NAME}_adhoc.ipa" --sign
"${DEVELOPPER_NAME}" --embed "${ADHOC_PROVISONNING_PROFILE}"
echo "* xcrun Package app (ipa file) - AppStore release"
/usr/bin/xcrun -sdk iphoneos PackageApplication "${PROJECT_BUILDDIR}/${PROJECT_NAME}.app" -o
"${PROJECT_BUILDDIR}/${PROJECT_NAME}_appstore.ipa" --sign
"${DEVELOPPER_NAME}" --embed "${APPSTORE_PROVISONNING_PROFILE}"
It was working fine before. But then I installed Mac OS Maverik and I also updated my expired certificates & prov profiles. And since then, when I try to upload the generated IPA to iTunes Connect (for the Distribution release) or TestFlight (for the Adhoc release), I get this error message:
ERROR ITMS-9000: "Invalid Code Signing. The executable
'Payload/mosa_en_it.app/mosa_en_it' must be signed with the
certificate that is contained in the provisioning profile." at
SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)
But it's working when I do it manually on XCode (Archive->Distribute..).
Also, I don't know if it's related but I have lots of duplicates certificates: screenshot
(but I don't know how to delete them)
Thanks in advance for your help