2. In today’s article, we gonna discuss how Flutter’s build system
converts Flutter project with its goods into an iOS application
bundle.
We will also let you know the purpose of generated objects so
that it can help you to integrate the same processes with your
custom build environment.
First Let’s Discuss the Workflow:
When your application is ready to release to make the build
process easy you can use Flutter tooling as it helps to make the
entire build process easy.
But some of the developers didn’t think this way and they don’t
find the process as configurable for their custom build or CI
(Continuous Integration) setups.
3. If you have a custom Xcode build than all the vision added by
Flutter tooling is optional and you can configure the build that
suits your workflow.
These all information we discuss applies to iOS applications
bundles prepared for release to the App Store which means
projects built to Flutter’s release mode.
To support toolings such as observatory and hot reload profile
mode uses a different runtime and packaging model.
5. If you want to create similar to a typical iOS app bundle then you
can use the flutter build iOS – release command that contains the
application executable along with any referenced framework and
resources.
What required to compile the Application?
While the installation process starts to install the SDK, at that
time flutter tools are cached on into the machine. To check the
same you can see under bin/cache directory which is available in
the copy of the Flutter SDK.
This directory contains all the versioned tool that is required to
work with Flutter so you can integrate any step of the process
into your own build system.
6. Let me introduce to you some of the files
that are unique to Flutter’s iOS app bundles
– Flutter Engine Framework Bundle:
Flutter.framework directory bundled as an iOS framework bundle,
that includes Flutter Engine and Assets that are referenced by the
Flutter Engine.
1. Flutter Engine:
Include core libraries like file, network I/O, file, accessibility,
plugin architecture, and support, the Skia renderer and the
DartVM.
2. Assets referenced by Flutter Engine:
This is just ICU data currently.
7. Ahead-Of-Time Framework Hustle:
An AOT snapshot of all the Dart application code that is written
by the user is contained by the App.Framework bundle.
Whenever a release builds, the compiler performs the tree
shaking on the Dart code. Hence only the code that is used to
end up in the bundle.
The necessary artifacts that are used to create the
App.framework bundle are getting generated under machine tool
cache by the gen_snapshot.
8. The Ahead-Of-Time Snapshot:
This library contains the ahead-of-time code that is compiled
from Dart to Machine native bits.
The four main symbols contained by the snapshot library that
gets generated by gen_snapshot and these symbols can be
dumped by nm command.
For example:
Runner.app/Frameworks/App.framework/App (for architecture
arm64):
00000000004041a0 S _kDartIsolateSnapshotData
0000000000009000 T _kDartIsolateSnapshotInstructions
00000000003fc740 S _kDartVmSnapshotData
0000000000005000 T _kDartVmSnapshotInstructions
9. The purpose behind the AOT Snapshot:
1. DartVM Snapshot:
● kDartVmSnapshotData
● This represents the initial state of the Dart heap shared
between isolates.
● Helps to launch Dart isolates faster but it doesn’t contain any
isolate-specific information.
2. DartVM Instructions:
● kDartVmSnapshotData
● Have all AOT instructions for common routines.
● This information gets shared between all Dart isolates in the
VM.
● Extremely small snapshot and also contains stubs.
10. 3. Isolate Snapshot:
● kDartIsolateSnapshotData
● The initial state of Dart heap represents by these.
● Also includes isolate-specific information
4. Isolate Instructions:
● kDartIsolateSnapshotinstructions
● Have the AOT code that gets executed by the Dart isolate.
Flutter tools make sure that the assets that are referred by the
application and its plugin end up in the app bundle.
These can be easily done by just reading the assets that are listed
in the project’s pubspec.yaml file.
11. Global Network
USA
4811 N Harding Ave,
Chicago IL 60625
P: +1 (903) 200-8801
CANADA
1445 Rennie St Oshawa,
Ontario, L1K 0N9,CANADA
P: (416) 272-0981
INDIA
609/610,City Center Science
City Road
Ahmedabad - 380060
P: +919586777575
UK
6 Hastings Avenue
Ilford , IG6 1DZ
P: +44 (798) 560 0352
12. Web & Mobile App Development Company
https://www.concettolabs.com