I am trying to build my flutter iOS App but I don't know how to get the ipa file.
pool:
name: Default
demands: xcode
steps:
- task: aloisdeniel.flutter.flutter-install.FlutterInstall@0
displayName: 'Flutter Install'
- task: aloisdeniel.flutter.flutter-build.FlutterBuild@0
displayName: 'Flutter Build ios'
inputs:
target: ios
projectDirectory: 'src/Apps/platypus_app'
buildName: '$(Build.BuildNumber)'
entryPoint: 'lib/main_staging.dart'
iosCodesign: false
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: 'src/Apps/platypus_app/build/ios'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: InstallAppleCertificate@2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: 'ZooKeeper_Certs.p12'
certPwd: ZooK33periOSKeyStore
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: '$(build.artifactstagingdirectory)'
artifact: 'platypus_drop'
This pipeline builds but I get the following output:
There is no .ipa file so I think there is another step I have to do, but I am no iOS dev.
It brings together multiple services commonly used by mobile developers, including build, test, distribute, monitoring, diagnostics , etc., into one single integrated cloud solution.
Flutter build task for Azure DevOps. Installation can be done using Visual Studio MarketPlace. Source code can be found on Github. Add the tasks to your build definition. Installs the Flutter SDK onto the running agent if not already installed.
Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to test and build your code and ship it to any target constantly and consistently. Today we gonna use Azure Pipelines to help us achieve full automated deployment flow for our Flutter applications. So without further ado let’s dive into the tutorial
Add Xcode task after flutter task in your pipeline. Set the packageApp attribute to true. Set the exportPath attribute. The path you set for exportPath attribute is where the .ipa will be generated.
However, there are some workarounds to get support for Flutter in App Center. You must first install the Azure Pipelines Flutter extension to distribute Flutter apps using App Center Distribute and Azure Pipelines. It is also a good idea to setup a service connection for App Center in Azure Pipelines, you can read more about that here.
You will need xCode task to generate .ipa file. See document here.
Add Xcode task after flutter task in your pipeline. Set the packageApp
attribute to true
. Set the exportPath
attribute. The path you set for exportPath
attribute is where the .ipa will be generated. See below example:
- task: Xcode@5
inputs:
actions: 'archive'
sdk: '$(sdk)'
scheme: '$(scheme)'
configuration: '$(configuration)'
xcodeVersion: 'default' # Options: default, 10, 9, 8, specifyPath
archivePath: 'src/Apps/platypus_app/build/ios/Runner.xcarchive'
exportPath: 'src/Apps/platypus_app/build/ios'
packageApp: true
xcWorkspacePath: src/Apps/platypus_app/build/ios/Runner.xcworkspace
signingOption: 'nosign'
Another workaround is to use a bash task to run xcodebuild
command to generate .ipa file in your pipeline. See below example:
The .ipa file will be exported to the folder specified for -exportPath
attribute
- task: Bash@3
displayName: 'Create ipa 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.ipa
Please check out this thread for more information.
You need to include the ExportOptions.plist
file with flutter build ipa
and you will get an ipa output in build/ios/ipa/your_app.ipa
- task: Bash@3
displayName: "Build flutter iOS release"
inputs:
targetType: inline
script: |
flutter build ipa --release --build-name=1.0 --build-number 1 --export-options-plist=path/to/exportOptions.plist
Read here for more details: https://flutter.dev/docs/deployment/ios#create-a-build-archive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With