flutter/dev/integration_tests/ios_host_app
Victoria Ashworth fe1c9d61a7
Validate build configuration during Xcode build phase (#169395)
You can run iOS/macOS Flutter apps through either the Flutter CLI or
Xcode. However, it's often required to first run the Flutter CLI to
generate required files and settings. Some of these settings/files (like
dev dependencies) are specific to the build mode. However, you can
change the build mode through Xcode too. When you change the build mode
through Xcode, the Flutter-generated files and setting may not be
correct.

This PR checks if the current build mode matches the one last used by
the Flutter CLI. If it doesn't, it'll print a warning like this:

![Screenshot 2025-05-23 at 5 14
58 PM](https://github.com/user-attachments/assets/47d15cc4-f05d-4034-8be6-67f37828aa61)

If the build action is `install`, which indicates the app is being built
for distribution, this will print as an error and fail the build:

![Screenshot 2025-05-23 at 5 16
12 PM](https://github.com/user-attachments/assets/339b65bd-6425-4595-b26b-a60c722bbcf9)


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-29 19:00:56 +00:00
..
flutterapp/lib Revert "Add set semantics enabled API and wire iOS a11y bridge (#1612… (#165901) 2025-03-25 18:24:46 +00:00
FlutterUITests Retry button tap in [FlutterUITests testFlutterViewWarm] (#143967) 2024-02-23 16:13:21 +00:00
Host Remove "note that" in our documentation (as per style guide) (#120842) 2023-02-17 22:27:33 +00:00
Host.xcodeproj iOS: Update minimum iOS version to 13.0 (#167737) 2025-04-24 20:15:13 +00:00
Host.xcworkspace Fixes to support add2app on iOS (#22277) 2018-09-26 01:57:05 -04:00
Podfile Validate build configuration during Xcode build phase (#169395) 2025-05-29 19:00:56 +00:00
PodfileMissingPostInstall Validate build configuration during Xcode build phase (#169395) 2025-05-29 19:00:56 +00:00
README.md Added missing code block language in docs (#147481) 2024-05-01 14:44:27 +00:00

iOS host app

Used by the module_test_ios.dart device lab test.

iOS host app for a Flutter module created using

$ flutter create -t module hello

and placed in a sibling folder to (a clone of) the host app. flutterapp/lib/marquee.dart and flutterapp/lib/main.dart must be copied into the new module lib for platform unit tests to pass.

This application demonstrates some basic functionality for Add2App, along with a native iOS ViewController as a baseline and to demonstrate interaction.

  1. A regular iOS view controller (UIViewController), similar to the default flutter create template (NativeViewController.m).
  2. A FlutterViewController subclass that takes over the full screen. Demos showing this both from a cold/fresh engine state and a warm engine state (FullScreenViewController.m).
  3. A demo of pushing a FlutterViewController on as a child view.
  4. A demo of showing both the native and the Flutter views using a platform channel to interact with each other (HybridViewController.m).
  5. A demo of showing two FlutterViewControllers simultaneously (DualViewController.m).

A few key things are tested here (FlutterUITests.m):

  1. The ability to pre-warm the engine and attach/detach a ViewController from it.
  2. The ability to use platform channels to communicate between views.
  3. The ability to simultaneously run two instances of the engine.