What exactly does Flutter build iOS do? Is this really necessary?
531
The reason you should run a flutter build ios
before archive is because archive uses the last build configuration from the results of running flutter build ios
.
Author by
Tomas Baran
Updated on November 21, 2022Comments
-
Tomas Baran over 1 year
I would like to fully understand this command and what happens behind the scenes. Here are a few pieces of information I've understood so far but somehow I cannot connect the dots:
- When deploying an iOS we need to go through these steps:
- build a flutter app in release mode, which will make an .app file/folder
- archive & sign the .app file which will convert it into .ipa
- send the signed .ipa to the appstore
- flutter apps can have 3 modes: 1. debug 2. release 3. profile
- running
flutter build ios
creates a build/ios folder, including the Release-iphoneos/Runner.app - Xcode creates its own .app in ~/Library/Developer/Xcode/DerivedData/Runner-...
Now, questions:
- Is the build/ios/Release-iphoneos/Runner.app that Xcode converts into .ipa? I'm asking since I know that Xcode creates its own .app in ~/Library/Developer/Xcode/DerivedData, so I'm not sure if Xcode just copies build/ios/Release-iphoneos/Runner.app in here: ~/Library/Developer/Xcode/DerivedData/ or not
- What happens if I don't run
flutter build ios
before? Will Xcode use only a debug mode of my app? If so, how come it removes the debug flag in the upper right corner? - When I clean my build folder in Xcode (shift+cmd+K) and then I archive the app and it will still build a new .app and then it converts it to .ipa. What mode was this .app created in? Was it a release app? If so, again, why is it necessary to run
flutter build ios
before and why not just archive it from the Xcode?
Thanks to everyone who tries to unleash this big mystery for me and for everyone else wondering.