vsts-flutter-tasks
vsts-flutter-tasks copied to clipboard
ipa file
Where is the ipad file? May you please add commands that releases ipa file.
@MoeHamdan Hi, Did you get any solution on this?
Hello @praveen070290 Yes, I built it without signing then used xCode task to generate the ipa.
@MoeHamdan, Great, Could you please share me your .yml file...
Sure @praveen070290 , kindly find it below. However make sure before that you open your project in xCode the iOS part and configure the release configuration.
trigger:
branches:
include:
- master
- feature/*
paths:
include:
- ca_demo
variables:
scheme: ''
sdk: 'iphoneos'
configuration: 'Release'
stages:
- stage: Build
displayName: Build
jobs:
- job: Build
displayName: Build job
pool:
vmImage: 'macOS-latest'
steps:
- task: GitVersion@5
inputs:
runtime: 'core'
- task: InstallAppleCertificate@2
displayName: 'Install an DevApple certificate'
inputs:
certSecureFile: ios_dist.p12
certPwd: '<<YourPassword>>'
- task: InstallAppleProvisioningProfile@1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'DemoMoe.mobileprovision'
- task: FlutterInstall@0
inputs:
channel: 'stable'
version: 'latest'
- task: FlutterBuild@0
displayName: 'Flutter Build ios'
inputs:
target: 'ios'
projectDirectory: 'ca_demo'
buildName: '$(Build.BuildNumber)'
iosCodesign: false
- task: Xcode@5
displayName: 'Export ipa'
inputs:
actions: 'archive'
scheme: 'Runner'
packageApp: true
configuration: 'release'
workingDirectory: 'ca_demo/ios'
exportOptions: 'auto'
exportMethod: 'ad-hoc'
exportTeamId: '<<TeamId>>'
provisioningProfileUuid: $(APPLE_PROV_PROFILE_UUID)
signingOption: 'manual'
signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY)
archivePath: ca_demo/ios/build/Runner.xcarchive
exportPath: ca_demo/ios/build
teamId: '<<TeamId>>'
xcWorkspacePath: ca_demo/ios/Runner.xcworkspace
args: '-verbose'
- task: FlutterBuild@0
displayName: 'Flutter Build android'
inputs:
target: 'apk'
projectDirectory: 'ca_demo'
buildName: '$(Build.BuildNumber)'
- task: Bash@3
displayName: Copy files to artifact folder
inputs:
targetType: 'inline'
script: |
mkdir artifacts
mkdir -p artifacts/ios
mkdir -p artifacts/android
cp build/app/outputs/apk/release/app-release.apk artifacts/android/ca_demo_app_$(Build.BuildNumber).apk
cp ios/build/ca_demo_app.ipa artifacts/ios/ca_demo_app_$(Build.BuildNumber).ipa
workingDirectory: '$(System.DefaultWorkingDirectory)/ca_demo'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/ca_demo/artifacts'
ArtifactName: 'artifacts'
publishLocation: 'Container'
@MoeHamdan Thanks, It works a lot. Thanks again...
@MoeHamdan
Man, Could you please help me with release too? I tried multiple time but it is throwing error,
ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle com.xxxxxx.xxxxxxx [Payload/Runner.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
Hello @praveen070290 If you open your project in xCode and configure the Release configuration with what you need and save it, your problem should be solved.
@MoeHamdan, Successfully build the pipeline, I am talking about the release part of Azure devops (Where to export the builded IPA file to Test flight) , As in the picture...
Note: I used the development certificate and provisioning profile to build the IPA file in the pipeline.



oh @praveen070290 I see. The problem here is that you will need the ipa to be provisioned with App Store provisioning profile and App Store certificate else it will not work, thus the error you are getting.
@MoeHamdan , Do we need to resign the ipa? I installed the distribution certificate and provisioning profile in the release machine, but still the same error.... I build the IPA with development certificates and release with distribution, but the same error occurring.. Stuck for a long time..
@MoeHamdan Is your ios_dist.p12 a distribution or development certificate?
Yes the ipa file should be signed and provisioned with APPLE STORE provisioning profile and certificate. What you can do if you want 2 ipa files is that you can build 2 of them 1 with development/distribution and another with APPLE STORE so you can push it to test flight.
Okay, Let me try one more time with distribution certificate. Also could you please give me your mail id?
Hello @MoeHamdan ! I still can't sign my build and get my IPA with the azure-pipelines.yaml provided.
You said to configure the project with XCode, what need to be configured?
I was able to get IPA file with Xcode on a MacBook and also with AppCenter but never on Azure DevOps. My Xcode task always fails with error 65.
For information, I questioned StackOverflow here. I'm interested in any idea :) I'm stuck 🙈
I'm using those tasks on my side. There's two consecutive builds, but at least it works ...
More info on the ci/ExportOptions.plist file.
- task: YamlWriter@0
displayName: 'Update pubspec'
inputs:
file: 'pubspec.yaml'
set: version='${{ parameters.package_version }}+$(Build.BuildId)'
- task: ios-bundle-version@1
displayName: 'Update Info.plist'
inputs:
sourcePath: 'ios/Runner/Info.plist'
versionCodeOption: 'buildid'
versionCode: '$(Build.BuildId)'
versionName: '${{ parameters.package_version }}'
printFile: true
- task: FlutterBuild@0
displayName: 'Flutter Build app (iOS)'
inputs:
target: 'ios'
buildFlavour: prod
entryPoint: lib/main_prod.dart
buildNumber: '$(Build.BuildId)'
buildName: '${{ parameters.package_version }}'
- task: Bash@3
displayName: 'Prepare an App Store package'
inputs:
targetType: 'inline'
script: |
xcodebuild -workspace ios/Runner.xcworkspace -scheme prod -sdk iphoneos -configuration Release-prod archive -archivePath build/ios/Runner.xcarchive
xcodebuild -exportArchive -archivePath build/ios/Runner.xcarchive -exportOptionsPlist ci/ExportOptions.plist -exportPath build/ios/App-${{ parameters.package_version }}.ipa
I finally succeeded to build the IPA with a force commit to Podfile (podfile generated on a MacBook). I will try your solution to maybe avoid commit those files. Thanks! 👍
Flutter now has a flutter build ipa command so it would be nice if that could be supported.