Flutter - Generate .ipa file - ios

The official Flutter documentations says that the following command produces both ipa and xcarchive files.
flutter build ipa
From the Flutter documentation to generate ipa
Run flutter build ipa to produce an Xcode build archive (.xcarchive
file) in your project’s build/ios/archive/ directory and an App Store
app bundle (.ipa file) in build/ios/ipa.
However, the command is generating only .xcarchive file. How can we generate the .ipa file? Looks like we can generate from Xcode Export but trying to look for a command line command to generate .ipa file to integrate into CI/CD solution.

You can generate .ipa file for distribution using Xcode via following steps
1.Open iOS folder of your project in Xcode
then Product -> Archive
It once this is complete open up the Organiser and click the latest version.
3.Now click on Distribute App This will open list of method for export. Select the export method as per your requirement (In your case i think you want to distribute app for testing) so select Development option and click on Next button.
4.Now it will ask for app thining and re-signed for development distribution select Automatically managing signing it take some time to generate .ipa file after that you can export .ipa file in your desire location.

When you run flutter build ipa, it generates a Runner.xcarchive and an IPA.
Output of flutter build:
Xcode archive done. 65.6s
Built /Users/user/repos/app_name/build/ios/archive/Runner.xcarchive.
Building App Store IPA... 64.5s
Built IPA to /Users/user/repos/app_name/build/ios/ipa.
The generated file is called app_name.ipa.

Related

Which IPA build is correct for App Store?

I have noticed that there are 2 ways to create IPA for App store.
1- Create Runner.xcarchive file and then with Xcode export IPA file.
2- When you're creating Runner.xcarchive file, flutter creates an IPA for you as well(Flutter command: flutter build ipa). example: 👇👇👇👇
project-app % flutter build ipa
💪 Building with sound null safety 💪
Archiving com.example.app.dev...
Automatically signing iOS for device deployment using specified development team in Xcode project: *********
Running Xcode build...
└─Compiling, linking and signing... 13.6s
Xcode archive done. 62.4s
Built /Users/user/StudioProjects/project/app/build/ios/archive/Runner.xcarchive.
Building App Store IPA... 20.8s
Built IPA to /Users/user/StudioProjects/project/app/build/ios/ipa.
To upload to the App Store either:
1. Drag and drop the "build/ios/ipa/*.ipa" bundle into the Apple Transport macOS app https://apps.apple.com/us/app/transporter/id1450874784
2. Run "xcrun altool --upload-app --type ios -f build/ios/ipa/*.ipa --apiKey your_api_key --apiIssuer your_issuer_id".
See "man altool" for details about how to authenticate with the App Store Connect API key.
If I use the IPA that Flutter provides in the second option, is it the same as the first way?
Yes, creating an .ipa file using either of the methods you described should result in the same file.
To create an .ipa file using the first method you described, you would first need to build an .xcarchive file using Xcode. Then, you can use Xcode's "Export" feature to create an .ipa file from the .xcarchive.
The second method you described involves using the Flutter command flutter build ipa to create an .ipa file directly. This command will create an .ipa file that can be used to distribute your Flutter app on the App Store.
In both cases, the resulting .ipa file should be the same and can be used to distribute your app on the App Store.

How to define a output name for flutter build ipa?

I could not find a parameter to define the output filename of the ipa file. Is there an easy way to set the ouput filename?
I use an azure pipeline to build my ipa file:
- script: flutter build ipa --export-options-plist=ios/exportOptions.plist --build-number=$(Build.BuildNumber)
displayName: Build iOS adHoc
I want to generate 2 ipa files. One for the AppStore with an AppStore profile and one with adHoc Profile. For that i want a second command but i cant find an easy way to declare a filename so i can have both files generated.
I was looking for this as well. There is a note about it here.
https://flutter.dev/docs/deployment/ios
Note: When you export your app at the end of Distribute App, Xcode
will create a directory containing an IPA of your app and an
ExportOptions.plist file. You can create new IPAs with the same
options without launching Xcode by running flutter build ipa
--export-options-plist=path/to/ExportOptions.plist. See xcodebuild -h for details about the keys in this property list.

How to find IPA file through ApplicationLoader

I work in Visual Studio for Windows. For building iOS app VS use Mac as build server. After building process I have IPA file at the windows host.
Than I need to upload it through ApplicationLoader. But ApplicationLoader is running on Mac and how can it access to windows host ipa?
The Visual Stuiod has command 'Show IPA file on build server' and when I use it I see finder is opened at someplace at Mac. But what is this place?
I start ApplicationLoader and try to find this IPA file without success.
Where is it? As workaround I copied (drag&drop) ipa file from this unknown folder to Mac desktop and selected the file from there.
When I upload ipa to iTunesConnect I don't see loaded symbols! Why the symbols isn't loaded?
And the last. I heard about fastlane that it prefer way to upload symbols to Crashlytics. So how can it worked as project files placed in Windows host?
You can't find ipa file after archive because it will not create ipa.
You need to create file manually .
Follow this steps to create .ipa
Right click on recent archive file in organisation and select show in finder option.
After you will .xcarchive file.
Right click on that file an select Show Package and content option.
Under Product folder. you can find .app file.
Drag .app file to application section in itunes after completion of process right click on icon and select show in finder option.
That's your ipa File .
Second solution
Build your project with production certificate .
After Build under product folder you can see .app file and show it in finder .
Follow to 5 and 6 from above solution.
You need to archive .ipa, not just build for release.

How to get an iOS app build for appium testing?

I wanted to setup iOS testing on simulator on my MacBook-pro. Im using appium 1.6 and Xcode 8 and iOS 10.1 as simulator OS. I ran my appium server and set the desired capabilities and used an .ipa from the app store and it crashes on launch while doing an inspect on appium. Is it happening because i don't have a app signed for development? what are the requirements for the app to be tested for using? Do i need signed apps to be used for testing on simulator too ?
You can create a .app file useing the belowing instruction:
1- Go to:
xcode > File > New Project > (select ios at top bar) select Tabbed Application > click Next > give project name and select swift as language and complete process.
2- Open the project and run it. After running the app in the simulator, you will find the project .app file in the product folder (expand your project in xcode > product.
you can use this .app file for your appium test.
3- You can also get a lot of free .xcode project on the web. download this project, open the .xcodeproj or .xcworkspace file in xcode and run it. you will find the .app file in the product folder
if you want to run your ios app in the simulator, you need a .app file, not .ipa file. The .ipa file runs on the device. Try to generate a .app file for simulator.
Yes, you need apps to be signed with a developer provisiioning profile. You can use the iresign to do it. you should input your ipa file developer provisioning file(contact your dev) and click resign. It will output the resigned app
The same dev provisioning file, dev certificate should be installed in your mac from where you run your scripts.
Note: you cannot run .ipa on simulators. you need .app version of the app , for which you need to contact the developer too

Provisional profile is missing when building for iOS 5.0

I am able to create the .ipa file for 4.2, but it fails when I do it for 5.0. In 5.0 when I archive the build, the provisioning profile is missing.
It successfully runs in the simulator and in my iPhone. When I select "Product->Archive" to build the archive, it successfully archives the project but it losses the identifier name, and the version is 'Unspecified'. When I press the "Share" button it doesn't find the provisioning profile and can't build the ipa file.
How can I get the ipa file built?
you need to download the .mobileprovision files from developer.apple.com. You can just double click the files in finder and install them. Be sure in the build settings to point them to proper distro profiles/developer profiles.
SOLVED - Actually the the project was done with xcode 3.2.6 and it had two dependencies. When it was transitioned to 4.2, build setting wasn't changed. I had to convert the build settings of 2 dependencies and the main application then i could build the ipa file.

Resources