Important notes:
-
These instructions are for building from source. Developer workflow for iOS will get a lot simpler once we publish the precompiled iOS binaries in the public Flutter SDK.
-
Dart precompilation for iOS is landing soon. This will make the builds much faster.
-
Download depot_tools and make sure it is in your path.
-
Create an empty directory for your copy of the repository. Call it what you like. For the sake of the instructions that follow, we'll call it flutter.
-
Create a .gclient in the flutter directory with the following contents:
solutions = [ { "managed": False, "name": "src", "url": "git@github.com:flutter/engine.git", "custom_deps": {}, "deps_file": "DEPS", "safesync_url": "", }, ] target_os = ["android"]
-
Download the Flutter source
cd flutter gclient sync
-
Check out a version of Flutter that’s known to run on iOS:
git checkout origin/known_good_ios gclient sync
-
Build for iOS (to use a real device omit --simulator and _sim)
cd src ./sky/tools/gn --ios --simulator ninja -C out/ios_sim_Debug/ -j 200
-
Open the harness xcode project for the app you want to preview.
-
To run the game project in examples/game:
open out/ios_sim_Debug/game_app_xcode/Harness.xcodeproj/
-
To run the Stocks project in examples/stocks:
open out/ios_sim_Debug/stocks_app_xcode/Harness.xcodeproj/
-
-
Select the simulator or device that you want to test on and press play. If you don’t see the simulator you want, click on the Project and change the deployment target to match an OS version that you have the simulator for.
-
You can make changes to the app (Stocks app's source code is in flutter/examples/stocks) using Atom (install the dartlang and linter packages) or another text editor of your choice.