I am trying to build .ipa file in codemagic, but it fails with below message
Archive Execute "xcodebuild -project . -scheme Optivio -archivePath build/ios/xcarchive/_ijalmu93.xcarchive archive COMPILER_INDEX_STORE_ENABLE=NO"
Failed to archive .
Build failed :| Step 7 script
Build .ipaexited with status code 66
and my code in yaml file for build ipa is,
xcode-project build-ipa --project "$XCODE_PROJECT" --scheme "$XCODE_SCHEME"
I don't have workspace, only project. when archive in Xcode got success.
Code magic screenshot: https://ibb.co/YjFg0gh
My full yaml file below,
workflows:
ios-testApp:
name: ios_testApp
environment:
vars:
XCODE_PROJECT:: “TestApp.xcodeproj" # <-- Put the name of your workspace here.
XCODE_SCHEME: "TestApp" # <-- Put the name of your scheme here.
# Set up env vars for manual codesigning (See - https://docs.codemagic.io/code-signing-yaml/signing-ios/)
CM_CERTIFICATE: Encrypted(…….) # <-- Put your encrypted distribution certificate here.
CM_CERTIFICATE_PASSWORD: Encrypted(…….) # <-- Put your encrypted distribution certificate password here.
CM_PROVISIONING_PROFILE: Encrypted(…….) # <-- Put your encrypted provisioning profile here.
xcode: 12.4
cocoapods: default
triggering:
events:
- push
- tag
- pull_request
branch_patterns:
- pattern: 'master'
include: true
source: true
scripts:
- name: Initialize keychain to be used for codesigning using Codemagic CLI 'keychain' command
script: |
keychain initialize
- name: set up provisioning profiles
script: |
PROFILES_HOME="/Users/vadivel/Library/MobileDevice/Provisioning Profiles"
mkdir -p "$PROFILES_HOME"
PROFILE_PATH="$(mktemp "$PROFILES_HOME"/$(uuidgen).mobileprovision)"
echo ${CM_PROVISIONING_PROFILE} | base64 --decode > $PROFILE_PATH
echo "Saved provisioning profile $PROFILE_PATH"
- name: Add signing certificate to keychain
script: |
echo $CM_CERTIFICATE | base64 --decode > /tmp/certificate.p12
keychain add-certificates --certificate /tmp/certificate.p12 --certificate-password $CM_CERTIFICATE_PASSWORD
- name: Set up code signing settings on Xcode project
script: |
xcode-project use-profiles
- name: Build .ipa
script: |
xcode-project build-ipa --project "$XCODE_PROJECT" --scheme "$XCODE_SCHEME"
artifacts:
- build/ios/ipa/*.ipa
- /Users/vadivel/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
publishing:
email:
recipients:
- [email protected]
notify:
success: true
failure: true
yamlabove, double check your project and scheme.