Reputation: 1768
I am android developer learning Flutter, and I really have some trouble trying to create debug .ipa file, for testing purposes.
So, I managed to create Runner.app file using command from Terminal:
flutter build ios --debug
The location of Runner.app file is
my_project_folder/build/ios/iphoneos/Runner.app
What to do next? Also, is there a way to create debug .ipa file from Xcode? Thanks.
Upvotes: 51
Views: 78120
Reputation: 47099
You can create the .ipa file yourself and send the iOS build URL to your client or others.
Just follow these steps:
Generate your iOS build with the command below:
flutter build ios --release/debug
You will find the path of your Runner.app, e.g.,
Built /Users/User_Name/Documents/App_Name/build/ios/iphoneos/Runner.app
Find this Runner.app file and copy/paste it to your Desktop.
Create a folder named "Payload" (case-sensitive) on your Desktop.
Move your Runner.app
file into the "Payload" folder.
Compress the "Payload" folder into the default .zip
format.
Convert/rename Payload.zip
to Payload.ipa
That's it! Now you have to open "Diawi" and upload the Payload.ipa
file to it. Wait until the upload is 100% complete, then click the send button. You will receive a URL. Send this URL to your client or any other person, and they can install the app on their device.
Note: Make sure the Diawi URL is valid for those UDIDs that are attached to your provisioning profile. Also, I haven't tried these steps to upload the app to TestFlight or the App Store.
Upvotes: 92
Reputation: 1026
I have a simple implementation combining a Makefile and Fastlane. This way, I can run make beta
from my project directory to deploy.
./Makefile
:
.PHONY: beta
beta:
flutter build ipa --export-options-plist=ExportOptions.plist
cd ios && fastlane beta ipa:../build/ios/ipa/YourBundleName.ipa
./ios/fastlane/Fastfile
:
platform :ios do
lane :beta do |options|
# ... pre-delivery actions, eg: `match(type: "appstore")`
pilot(
ipa: options[:ipa]
# ... the rest of your pilot configuration
)
# ... post-delivery actions, eg: `slack(message: "Uploaded to TestFlight")`
end
end
Note that I use match(type: "appstore")
, so that's why you see signingStyle
as manual
.
./ExportOptions.plist
:
<?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>compileBitcode</key>
<true/>
<key>method</key>
<string>app-store</string>
<key>provisioningProfiles</key>
<dict>
<key>your.bundle.identifier</key>
<string>Your Provisioning Profile Name</string>
</dict>
<key>signingCertificate</key>
<string>iOS Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>YourTeamId</string>
<key>thinning</key>
<string><none></string>
</dict>
</plist>
Upvotes: 3
Reputation: 346
flutter build ipa
is now available and takes an optional --export-options-plist
flag to make an IPA from the archive bundle. See flutter build ipa -h
on the master channel for details.
Upvotes: 33
Reputation: 107
I use the next bash-script
flutter build ios --debug
cd ios
xcodebuild -workspace Runner.xcworkspace -scheme Runner archive -archivePath Runner.xcarchive
xcodebuild -exportArchive -archivePath Runner.xcarchive -exportOptionsPlist ../scripts/exportOptions.plist -exportPath ../scripts -allowProvisioningUpdates
rm -fr Runner.xcarchive
ipa will be created at '../scripts'. You may have own path.
-allowProvisioningUpdates is using if you want xcodebuild updates certificates automaticaly.
exportOptions.plist - it's a file with distribution settings. I use next
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>method</key>
<string>enterprise</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>YOUR TEAM ID</string>
</dict>
</plist>
Upvotes: 2
Reputation: 7628
These are the next steps outlined in the instructions (which are found here: https://flutter.io/ios-release/):
In Xcode, configure the app version and build:
In Xcode, open Runner.xcworkspace in your app’s ios folder.
Select Product > Scheme > Runner.
Select Product > Destination > Generic iOS Device.
Select Runner in the Xcode project navigator, then select the Runner target in the settings view sidebar.
In the Identity section, update the Version to the user-facing version number you wish to publish.
In the Identity section, update the Build identifier to a unique build number used to track this build on iTunes Connect. Each upload requires a unique build number.
Finally, create a build archive and upload it to iTunes Connect:
Select Product > Archive to produce a build archive.
In the sidebar of the Xcode Organizer window, select your iOS app, then select the build archive you just produced.
Click the Validate… button. If any issues are reported, address them and produce another build. You can reuse the same build ID until you upload an archive.
After the archive has been successfully validated, click Upload to App Store…. You can follow the status of your build in the Activities tab of your app’s details page on iTunes Connect.
Upvotes: -1