问题
I am looking into some issues surrounding a build pipeline our team has created to push iOS applications to testflight. The specific issue that is being displayed is as follows:
ERROR ITMS-90174: "Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision."
We are able to successfuly upload to testflight from developers local machines but the IPA generated by DevOps cannot be uploaded in the same way, either through the pipeline or even locally. After some digging I believe the issue to be with the info.plist that is being generated for the xcarchive in azure. If I compare one that is generated by a developers local machine to the DevOps one I can see quite a bit of difference as shown below.
info.plist generated by Azure DevOps:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationProperties</key>
<dict>
<key>ApplicationPath</key>
<string>Applications/SampleApp.app</string>
<key>CFBundleIdentifier</key>
<string>extracted.bundle.identifier</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>2</string>
<key>SigningIdentity</key>
<string></string>
<key>Team</key>
<string></string>
</dict>
<key>ArchiveVersion</key>
<integer>2</integer>
<key>CreationDate</key>
<date>2020-06-11T23:53:43Z</date>
<key>Name</key>
<string>SampleApp</string>
<key>SchemeName</key>
<string>SampleApp</string>
</dict>
</plist>
Info.plist generated on devs machine:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationProperties</key>
<dict>
<key>ApplicationPath</key>
<string>retracted</string>
<key>CFBundleIdentifier</key>
<string>retracted.bundle.identifier</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>7</string>
<key>SigningIdentity</key>
<string>iPhone Distribution: Team Name (Team ID)</string>
<key>Team</key>
<string>retracted</string>
</dict>
<key>ArchiveVersion</key>
<integer>2</integer>
<key>CreationDate</key>
<date>2020-06-09T20:23:56Z</date>
<key>Distributions</key>
<array>
<dict>
<key>certificateSHA1</key>
<string>retracted</string>
<key>destination</key>
<string>upload</string>
<key>identifier</key>
<string>retracted</string>
<key>preparationEvent</key>
<dict>
<key>date</key>
<string>2020-06-09T20:24:08Z</string>
<key>errors</key>
<array/>
<key>infoMessages</key>
<array/>
<key>shortTitle</key>
<string>Prepared</string>
<key>state</key>
<string>success</string>
<key>title</key>
<string>Prepared archive for uploading</string>
<key>warnings</key>
<array/>
</dict>
<key>task</key>
<string>distribute</string>
<key>teamID</key>
<string>retracted</string>
<key>uploadDestination</key>
<string>App Store</string>
<key>uploadEvent</key>
<dict>
<key>date</key>
<string>2020-06-09T20:26:54Z</string>
<key>errors</key>
<array/>
<key>infoMessages</key>
<array/>
<key>shortTitle</key>
<string>Uploaded</string>
<key>state</key>
<string>success</string>
<key>title</key>
<string>Uploaded to Apple</string>
<key>warnings</key>
<array/>
</dict>
</dict>
</array>
<key>Name</key>
<string>retracted-name</string>
<key>SchemeName</key>
<string>retracted-name</string>
</dict>
</plist>
I don't personally understand how this file is generated well enough to figure out what needs to change. Below are some screenshots of the xcode build step in our build pipeline that hopefully provide some more context:
We also complete some tasks in the build to set several settings in the applications info.plist such as the bundle identifier and version but this doesn't seem to have much impact on the info.plist that is generated.
The appropriate apple certificates and provisioning profiles are installed earlier in the build also.
Any assistance with what might be the issue here as it's been a roadblock for quite a while at this point
Edit to include yaml:
steps:
- bash: |
git clone $(repourl)
cd $(repo)
git checkout $(commithash)
pwd
ls
displayName: 'Bash Script'
- task: InstallAppleCertificate@2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: 'cdb0ceff-d9b7-4fdc-8528-c167875ae8b1'
certPwd: '$(password)'
signingIdentity: 'iPhone Distribution: Team Name ({team ID})'
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'fc77862a-92ea-4108-a953-6f8af7a2362b'
- bash: |
#!/usr/bin/env bash
plutil -replace CFBundleDisplayName -string "$(tpapp.AppName)" $(PlistFilePath)
plutil -replace CFBundleVersion -string "$(tpapp.BuildNumber)" $(PlistFilePath)
plutil -replace CFBundleShortVersionString -string "$(version)" $(PlistFilePath)
displayName: 'Bash Script'
- bash: |
#!/usr/bin/env bash
plutil -replace acuant_username -string "$(tpapp.AcuantUsername)" $(AcuantPlistFilePath)
plutil -replace acuant_password -string '$(tpapp.AcuantPassword)' $(AcuantPlistFilePath)
plutil -replace acuant_subscription -string "$(tpapp.AcuantSubscription)" $(AcuantPlistFilePath)
plutil -replace frm_endpoint -string "$(tpapp.AcuantFrmEndpoint)" $(AcuantPlistFilePath)
plutil -replace med_endpoint -string "$(tpapp.AcuantMedEndpoint)" $(AcuantPlistFilePath)
plutil -replace assureid_endpoint -string "$(tpapp.AcuantAssureIdEndpoint)" $(AcuantPlistFilePath)
displayName: 'Bash Script'
- bash: |
#!/usr/bin/env bash
plutil -replace CFBundleIdentifier -string "net.unifysolutions.acuant" $(PlistFilePath)
displayName: 'Bash Script'
- bash: |
cd $(System.DefaultWorkingDirectory)/$(repo)/SampleApp
agvtool new-version -all "2"
displayName: 'Bash Script'
- bash: |
sudo xcode-select -s /Applications/Xcode_11.2.1.app/Contents/Developer
displayName: 'Bash Script'
- bash: 'echo ''<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>method</key><string>app-store</string><key>teamID</key><string>{team ID}</string><key>teamName</key><string>Team Name</string><key>provisioningProfiles</key><dict><key>{bundleID}</key><string>prov profile name</string></dict></dict></plist>'' > exportOptions.plist'
displayName: 'Bash Script'
- task: Xcode@5
displayName: 'Xcode clean build archive'
inputs:
actions: 'clean build archive'
configuration: Release
xcWorkspacePath: ' $(System.DefaultWorkingDirectory)/$(repo)/SampleApp/SampleApp.xcodeproj'
scheme: SampleApp
packageApp: true
archivePath: output
exportOptions: plist
exportOptionsPlist: exportOptions.plist
signingOption: manual
signingIdentity: 'iPhone Distribution: Team Name ({team ID})'
provisioningProfileUuid: '$(provisioningprofile.provisioningProfileUuid)'
provisioningProfileName: '$(provisioningprofile.provisioningProfileName)'
args: '-destination generic/platform=iOS -allowProvisioningUpdates DEVELOPMENT_TEAM={team ID} PRODUCT_BUNDLE_IDENTIFIER={bundleID} CODE_SIGNING_ALLOWED=No '
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: output
- task: ms-vsclient.app-store.app-store-release.AppStoreRelease@1
displayName: 'Publish to the App Store TestFlight track'
inputs:
serviceEndpoint: 'AppStore Connection'
appIdentifier: {bundleID}
shouldSkipSubmission: true
teamId: {team ID}
teamName: 'Team Name'
来源:https://stackoverflow.com/questions/62336059/issues-with-publishing-ios-app-to-testflight-through-azure-devops