README.md
1# Scenario App
2
3This folder contains a dart:ui application and scripts to compile it to AOT
4for exercising embedders.
5
6It intentionally has no dependencies on the Flutter framework or tooling, such
7that it should be buildable as a presubmit or postsubmit to the engine even in
8the face of changes to Dart or dart:ui that require upstream changes in the
9Flutter tooling.
10
11To add a new scenario, create a new subclass of `Scenario` and add it to the
12map in `main.dart`. For an example, see animated_color_square.dart, which draws
13a continuously animating colored square that bounces off the sides of the
14viewport.
15
16## Building for iOS
17
18In this folder, after building the `ios_host` and `ios_profile` engine targets,
19run:
20
21```bash
22./compile_ios_aot.sh ../../../out/host_profile ../../../out/ios_profile/clang_x64/
23```
24
25This will create an `App.framework` copy it as well as the correct
26`Flutter.framework` to where the Xcode project expects to find them.
27
28You can then use `xcodebuild` to build the `ios/Scenarios/Scenarios.xcodeproj`,
29or open that in Xcode and build it that way.
30
31Currently, only AOT modes are supported.
32
33## Building for Android
34
35In this folder, after building the `host_profile` and `android_profile_arm64`
36engine targets, run:
37
38```bash
39./compile_android_aot.sh ../../../out/host_profile ../../../out/android_profile_arm64/clang_x64/
40```
41
42This will produce a suitable `libapp.so` for building with an Android app and
43copy it (along with flutter.jar) to where Gradle will expect to find it to build
44the app in the `android/` folder. The app can be run by opening it in Android
45Studio and running it, or by running `./gradlew assemble` in the `android/`
46folder and installing the APK from the correct folder in
47`android/app/build/outputs/apk`.
48