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.
Related
i have many projects embedded in single main project, i am trying to automate the build process. but issue is that i cant make build using command line.
Clean project
xcodebuild clean -project TestingCommandLine.xcodeproj -configuration Debug -alltargets
Make Archive
xcodebuild archive -project TestingCommandLine.xcodeproj -scheme "TestingCommandLine" -configuration Debug -archivePath myApp.xcarchive
Build IPA
xcodebuild -exportArchive -archivePath myApp.xcarchive -exportPath myApp.ipa -exportOptionsPlist exportOptions.plist
the same process works with simple project which does not have any dependencies.
The following build commands failed:
Ld watchos/Watch\ Extension.appex/iskanWatch\ Extension normal armv7k
(1 failure)
This is the actual failure error comes when i try to build.
Any help will be appreciated.
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'm trying to generate an adhoc IPA from the command-line but I cannot get it to works.
I can however generate an adhoc IPA from Xcode doing Product -> Archive and Export... in Organizer.
Here is how I proceed to generate an IPA on the command-line
xcodebuild -project DemoApp.xcodeproj -scheme DemoApp archive -archivePath build/DemoApp.xcarchive -configuration Release
xcrun -sdk iphoneos PackageApplication -v build/DemoApp.xcarchive/Products/Applications/DemoApp.app -o build/DemoApp.ipa --sign "iPhone Distribution" --embed DemoApp_Adhoc.mobileprovision
When I install the generated IPA via iTunes, it doesn't install properly on the device. The icon is greyed out and the title says "Installing..." like here.
I've checked the provisioning profile, the UUID, etc.
I tried with shenzhen but got the same behavior.
Can you spot what I'm doing wrong?
Thanks!
Finally I did not find the problem with PackageApplication but as a workaround I used PROVISIONING_PROFILE and CODE_SIGN_IDENTITY environment variable with the xcodebuild step and it worked.
Here are the new commands:
xcodebuild -project DemoApp.xcodeproj -scheme DemoApp archive -archivePath build/DemoApp.xcarchive -configuration Release PROVISIONING_PROFILE="00000000-0000-0000-0000-000000000000" CODE_SIGN_IDENTITY="iPhone Distribution: Company Inc (XXXXXXXXXX)"
xcrun -sdk iphoneos PackageApplication -v build/DemoApp.xcarchive/Products/Applications/DemoApp.app -o build/DemoApp.ipa")
I am trying to build IPA from terminal. I tried the following steps:
Step 1:
/usr/bin/xcodebuild -target "appname" -sdk "iphoneos" -configuration Release
Step 2:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "appname" -o "/Users/Pictures/" -sign "iPhone Developer:xxxxx" --embed /Users//Library/MobileDevice/Provisioning\ Profiles/xxxxxx.mobileprovision"
I didn't get any error but I am not getting any response. I have been waiting for more than 30 minutes. What am I missing here?
I have given a brief description of steps to follow, and parameters to pass while generating an ipa using terrminal below:
1) Go to the folder which contains the MyApp.xcodeproject file in terminal
2) By using the command given below you will get all the Targets of the application
/usr/bin/xcodebuild -list
3) After the above command is executed, you will get a list of targets of which you should select a specific target you need to generate .ipa
/usr/bin/xcodebuild -target $TARGET -sdk iphoneos -configuration Release
4) The above command builds the project and creates a .app file.The path to locate the .app file is"./build/Release-iphoneos/MyApp.app"
5) After Build gets succeeded then execute the following command to generate .ipa of the application using Developer Name and Provisioning Profile using the syntax below:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v “${TARGET}.app” -o “${OUTDIR}/${TARGET}.ipa” –sign “${IDENTITY}” –embed “${PROVISONING_PROFILE}”
Explanation of each Parameter in the above syntax:
${TARGET}.app == Target path (ex :/Users/XXXXXX/desktop/Application/build/Release-iphoneos/MyApp.app) ${OUTDIR} == Select the output directory(Where you want to save .ipa file) ${IDENTITY} == iPhone Developer: XXXXXXX (XXXXXXXXXX)(which can be obtained from Keychain access) ${PROVISONING_PROFILE} == Path to the provisioning profile(/Users/XXXXXX/Library/MobileDevice/Provisioning Profiles/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.mobileprovision”)
6)ipa will be generated at selected output directory "${OUTDIR}"
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