Flutter’s iOS Application Bundle


This document describes how Flutters build system converts your Flutter project (along with its assets), into an iOS application bundle. I hope to demystify some of the build steps and explain the purpose of generated artifacts, so that you can integrate the same processes into your custom build environment.
A note about workflow: When building your application for release, you may use Flutter tooling, which makes the build process easy. However, some developers may find that this process is not as configurable, or doesnt fit well in their custom build or continuous integration (CI) setups.
If you have a custom Xcode build or Gradle setup, all the "magic" added by Flutter tooling is optional, and you can configure the build to suit your own workflow.
All the information in this document applies to iOS application bundles prepared for release to the App Store. This means projects built to Flutters release mode. Compiling to either debug or profile mode uses a different runtime and packaging model in order to support tooling such as hot reload and observatory.
A Flutter application renders the user interface into a single view in the native view hierarchy.

本文档中的所有信息均适用于准备发布到App Store的iOS应用程序包这意味着为Flutter的发布模式构建的项目编译为调试或配置文件模式使用不同的运行时和打包模型以支持热重载和天文台等工具

The Application Bundle
The application bundle created using the flutter build ios --release command (or using your IDE) looks remarkably similar to a typical iOS app bundle that contains the application executable along with any referenced frameworks and resources.
Flutters generated bundle for the Runner app:

使用flutter build ios --release命令或使用您的IDE创建的应用程序包看起来非常类似于包含应用程序可执行文件以及任何引用的框架和资源的典型iOS应用程序包

Compiling the Application
When compiling a release mode version of the app (as opposed to profile or debug modes), artifacts from both the buildbots and your host machine are needed. (For more information on the buildbots, part of the engine build that uses GN and Ninja, see Contributing to the Flutter engine.)
When you install the SDK, Flutter tools are cached on your machine. You can see them by looking inside the bin/cache directory in your copy of the Flutter SDK. If you decide to integrate any steps of this process into your own build system, this directory contains all the versioned tools you need for working with Flutter.
The following sections describe some of the files unique to Flutters iOS app bundles.
Flutter Engine framework bundle
The Flutter.framework directory, packaged as an iOS framework bundle, includes:
Flutter engine
Contains the core libraries (for example, graphics, file and network I/O, accessibility support, plugin architecture), the DartVM, and the Skia renderer.
Assets referenced by the Flutter engine
This currently is just ICU data.
The buildbots generate the Flutter engine framework bundle, and the Flutter tools download and cache it on your machine.

在编译应用程序的发布模式版本时与配置文件或调试模式相反),需要来自buildbots和主机的工件 有关buildbots的更多信息使用GN和Ninja的引擎构建的一部分请参阅Conututing to Flutter引擎。)
安装SDK时Flutter工具将缓存在您的计算机上您可以通过查看Flutter SDK副本中的bin / cache目录来查看它们如果您决定将此过程的任何步骤集成到您自己的构建系统中则此目录包含使用Flutter所需的所有版本化工具
以下部分描述了Flutter iOS应用程序包的一些独特文件
Flutter Engine框架包
包含核心库例如图形文件和网络I / O可访问性支持插件架构),DartVM和Skia渲染器

Loading Disqus comments...
Table of Contents