### Setup Emulator and PM Serve Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/README.md Initializes the Fuchsia environment by setting up the emulator and starting the package serving daemon. ```bash fx set terminal.qemu-x64 ffx emu start --headless fx serve ``` -------------------------------- ### Setup and Run Tests Source: https://github.com/flutter-team-archive/engine/blob/main/tools/compare_goldens/README.md Install dependencies and run all Dart tests in the project. Ensure assertions are enabled for testing. ```sh dart pub get find . -name "*_test.dart" | xargs -n 1 dart --enable-asserts ``` -------------------------------- ### Starting DDS and Serving DevTools Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Using-the-Dart-Development-Service-(DDS)-and-Flutter-DevTools-with-a-custom-Flutter-Engine-Embedding.md Example of running the `dart development-service` command with the required `--vm-service-uri` and the `--serve-devtools` flag. The output shows the connection URIs for DDS and DevTools. ```bash $ dart development-service --vm-service-uri=http://127.0.0.1:59113/BBPoXnZUWFU=/ --serve-devtools {"state":"started","ddsUri":"http://127.0.0.1:59123/tbrR0DzW2j8=/","devToolsUri":"http://127.0.0.1:59123/tbrR0DzW2j8=/devtools?uri=ws://127.0.0.1:59123/tbrR0DzW2j8=/ws","dtd":{"uri":"ws://127.0.0.1:59122/R1LbdlhtkUygRWNA"}} ``` -------------------------------- ### Run Example App with Local Engine Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/android/README.md Run an example application, such as the video_player example, using a locally built Flutter engine. This is useful for testing specific package integrations. ```shell flutter run \ --local-engine-host=$ENGINE/out/host_debug_unopt_arm64 \ --local-engine=$ENGINE/out/android_debug_unopt_arm64 ``` -------------------------------- ### Example: Run 'embedder' Integration Test Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/flutter/tests/integration/README.md An example demonstrating how to run the 'embedder' integration test suite with the `--no-lto` flag. ```shell $ENGINE_DIR/flutter/tools/fuchsia/devshell/run_integration_test.sh embedder --no-lto ``` -------------------------------- ### Start Fuchsia package server Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/flutter/tests/integration/touch-input/README.md Starts a package server for Fuchsia, which is necessary for publishing and serving packages to the Fuchsia device or emulator. Navigate to your Fuchsia directory before running. ```shell cd "$FUCHSIA_DIR" fx serve ``` -------------------------------- ### Start Fuchsia emulator Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/flutter/tests/integration/touch-input/README.md Launches the Fuchsia emulator. This command is used to start a graphical instance of the Fuchsia operating system for testing. ```shell ffx emu start ``` -------------------------------- ### Get Help for run_tests.py Source: https://github.com/flutter-team-archive/engine/blob/main/testing/ios/IosUnitTests/README.md View available options and usage instructions for the `run_tests.py` script. ```sh flutter/testing/run_tests.py --help ``` -------------------------------- ### GLFW Example Embedder Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Custom-Flutter-Engine-Embedders.md This example embedder uses GLFW for window management and rendering, serving as a guide for custom embedder development. ```cc examples/glfw/FlutterEmbedderGLFW.cc ``` -------------------------------- ### Install FlameGraph Swift Tool Source: https://github.com/flutter-team-archive/engine/blob/main/impeller/docs/ios_cpu_profile.md Install the FlameGraph Swift command-line tool using Mint. This tool is used to convert captured profile data into HTML Flame Graphs. ```shell mint install lennet/FlameGraph ``` -------------------------------- ### Launching DevTools with VM Service URI Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Using-the-Dart-Development-Service-(DDS)-and-Flutter-DevTools-with-a-custom-Flutter-Engine-Embedding.md Demonstrates starting Flutter DevTools by providing the VM service URI as a positional argument. If DDS is not running, this command will start it automatically. ```bash $ dart devtools http://127.0.0.1:59251/2LS6f3Kb2JI=/ Started the Dart Development Service (DDS) at http://127.0.0.1:59260/38XeuQpIHRE=/ Serving DevTools at http://127.0.0.1:9101. Hit ctrl-c to terminate the server. ``` -------------------------------- ### Empty Build Configuration File Source: https://github.com/flutter-team-archive/engine/blob/main/ci/builders/README.md An example of an empty build configuration JSON file. Tests, generators, and archives can be omitted if they are empty. ```json { "builds": [], "tests": [], "generators": { "tasks": [] }, "archives": [ ] } ``` -------------------------------- ### Example CI Failure Output Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/embedder/fixtures/README.md This is an example of what a test failure might look like on a CI environment, showing image mismatch errors. ```txt [0;32m[ RUN ] EmbedderTest.VerifyB143464703WithSoftwareBackend\n[ERROR:flutter/shell/platform/embedder/tests/embedder_unittests_util.cc(199)] Image did not match expectation.\nExpected:/b/s/w/ir/cache/builder/src/out/host_debug_unopt/gen/flutter/shell/platform/embedder/assets/expectation_verifyb143464703_soft_noxform.png\nGot:/b/s/w/ir/cache/builder/src/out/host_debug_unopt/gen/flutter/shell/platform/embedder/assets/actual_verifyb143464703_soft_noxform.png\n\n../../flutter/shell/platform/embedder/tests/embedder_unittests.cc:1335: Failure\nValue of: ImageMatchesFixture("verifyb143464703_soft_noxform.png", rendered_scene)\n Actual: false\nExpected: true\n[ FAILED ] EmbedderTest.VerifyB143464703WithSoftwareBackend (8077 ms)\n[----------] 1 test from EmbedderTest (8080 ms total)\n\n[----------] Global test environment tear-down\n[==========] 1 test from 1 test suite ran. (8080 ms total)\n[ PASSED ] 0 tests.\n[ FAILED ] 1 test, listed below:\n[ FAILED ] EmbedderTest.VerifyB143464703WithSoftwareBackend\n\n 1 FAILED TEST\n[13/296] EmbedderTest.VerifyB143464703WithSoftwareBackend returned/aborted with exit code 1 (8226 ms)\n[14/296] EmbedderTest.VerifyB143464703WithSoftwareBackend (8484 ms)\n[INFO:test_timeout_listener.cc(76)] Test timeout of 300 seconds per test case will be enforced.\nNote: Google Test filter = EmbedderTest.VerifyB143464703WithSoftwareBackend\n[==========] Running 1 test from 1 test suite.\n[----------] Global test environment set-up.\n[----------] 1 test from EmbedderTest\n[ DISABLED ] EmbedderTest.DISABLED_CanLaunchAndShutdownMultipleTimes\n[ RUN ] EmbedderTest.VerifyB143464703WithSoftwareBackend\n[ERROR:flutter/shell/platform/embedder/tests/embedder_unittests_util.cc(199)] Image did not match expectation.\nExpected:/b/s/w/ir/cache/builder/src/out/host_debug_unopt/gen/flutter/shell/platform/embedder/assets/expectation_verifyb143464703_soft_noxform.png\nGot:/b/s/w/ir/cache/builder/src/out/host_debug_unopt/gen/flutter/shell/platform/embedder/assets/actual_verifyb143464703_soft_noxform.png\n\n../../flutter/shell/platform/embedder/tests/embedder_unittests.cc:1335: Failure\nValue of: ImageMatchesFixture("verifyb143464703_soft_noxform.png", rendered_scene)\n Actual: false\nExpected: true\n[ FAILED ] EmbedderTest.VerifyB143464703WithSoftwareBackend (8348 ms)\n[----------] 1 test from EmbedderTest (8350 ms total)\n\n[----------] Global test environment tear-down\n[==========] 1 test from 1 test suite ran. (8350 ms total)\n[ PASSED ] 0 tests.\n[ FAILED ] 1 test, listed below:\n[ FAILED ] EmbedderTest.VerifyB143464703WithSoftwareBackend\n ``` -------------------------------- ### Example linux_host_engine Target Configuration Source: https://github.com/flutter-team-archive/engine/blob/main/docs/ci/Engine-pre-submits-and-post-submits.md This JSON configuration defines the parameters for the `linux_host_engine` target, which is part of the pre-submit checks. ```json { "name": "linux_host_engine", "recipe": "engine_v2/engine_v2", "platform": "linux", "tests": [ { "name": "linux_host_engine_unopt_test", "test": "flutter/engine/src/test/engine_test.dart", "args": ["--no-enable-impeller"] } ] } ``` -------------------------------- ### Install Mint Package Manager Source: https://github.com/flutter-team-archive/engine/blob/main/impeller/docs/ios_cpu_profile.md Install the Mint package manager using Homebrew. Ensure your shell's profile is updated to include Mint's binary directory in your PATH. ```shell brew install mint ``` ```shell echo 'export PATH="$PATH:$HOME/.mint/bin"' >> ~/.profile source ~/.profile ``` -------------------------------- ### Configure GN Flags Source: https://github.com/flutter-team-archive/engine/blob/main/ci/builders/README.md Provides flags to the tools/gn script for configuring the build. This example sets runtime mode to debug, uses a prebuilt Dart SDK, and builds embedder examples. ```json "gn": [ "--runtime-mode", "debug", "--prebuilt-dart-sdk", "--build-embedder-examples" ], ``` -------------------------------- ### Sample CI Build Configuration Source: https://github.com/flutter-team-archive/engine/blob/main/ci/builders/README.md This YAML configuration shows how a build definition file is referenced within a CI setup. It specifies the recipe to use and properties like the SDK version. ```yaml - name: Mac mac_android_aot_engine recipe: engine_v2/engine_v2 timeout: 60 properties: config_name: mac_android_aot_engine $flutter/osx_sdk : >- { "sdk_version": "15a240d" } ``` -------------------------------- ### Get Help for CLI Source: https://github.com/flutter-team-archive/engine/blob/main/tools/gen_web_locale_keymap/README.md Display help information for the command-line interface of the generator script. ```bash dart --enable-asserts bin/gen_web_locale_keymap.dart -h ``` -------------------------------- ### Make EGL Context Current Source: https://github.com/flutter-team-archive/engine/blob/main/impeller/docs/standalone_gles.md Makes the created EGL context current on the calling thread, completing the WSI setup. ```c++ context->MakeCurrent(*surface); ``` -------------------------------- ### Publish touch-input-view package Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/flutter/tests/integration/touch-input/README.md Publishes the `touch-input-view` component package to the Fuchsia package server. This makes the component available for installation on the target system. ```shell $FUCHSIA_DIR/.jiri_root/bin/fx pm publish -a -repo $FUCHSIA_DIR/$(cat $FUCHSIA_DIR/.fx-build-dir)/amber-files -f $ENGINE_DIR/out/ fuchsia_debug_x64/gen/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/touch-input-view/touch-input-view/touch-input-view.far ``` -------------------------------- ### Run clang-tidy with Multiple Checks using Wildcards Source: https://github.com/flutter-team-archive/engine/blob/main/tools/clang_tidy/README.md Add multiple checks to the clang-tidy run using wildcards with the `--checks` flag. For example, to include all checks starting with `readability-`. ```shell dart ./tools/clang_tidy/bin/main.dart --checks="readability-*" ``` -------------------------------- ### Prepare Build Files (Windows) Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Use the gn tool to prepare build files for an unoptimized build on Windows. For gen_snapshot only, specify runtime mode and optional --android flag. ```bash python .\flutter\tools\gn --unoptimized ``` ```bash python .\flutter\tools\gn [--unoptimized] --runtime-mode=[debug|profile|release] [--android] ``` -------------------------------- ### CheckedNumeric<> Example Usage Source: https://github.com/flutter-team-archive/engine/blob/main/third_party/accessibility/base/numerics/README.md Example demonstrating the usage of CheckedNumeric<> and its boundary condition detection. ```APIDOC ## CheckedNumeric<> Example Usage ### Description This example demonstrates the usage of `CheckedNumeric<>` and its boundary condition detection. ### Code Example ```cpp #include "base/numerics/checked_math.h" ... CheckedNumeric variable = 0; variable++; variable--; if (variable.ValueOrDie() == 0) // Fine, |variable| still within valid range. variable--; variable++; if (variable.ValueOrDie() == 0) // Breakpoint or configured CheckHandler // Does not happen as variable underflowed. ``` ### Pattern for Safe Operations Comparison operators are explicitly not provided for `CheckedNumeric` types because they could result in a crash if the type is not in a valid state. Patterns like the following should be used instead: ### Code Example ```cpp // Either input or padding (or both) may be arbitrary sizes. size_t buff_size; if (!CheckAdd(input, padding, kHeaderLength).AssignIfValid(&buff_size) || buff_size >= kMaxBuffer) { // Handle an error... } else { // Do stuff on success... } ``` ``` -------------------------------- ### Prepare Build Files for Host-Side Executables Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Use this command to prepare build files for host-side executables. On Apple Silicon, add `--mac-cpu arm64` to avoid emulation and generate `host_debug_unopt_arm64`. ```bash ./flutter/tools/gn --unoptimized ``` -------------------------------- ### Install ImageMagick on MacOS Source: https://github.com/flutter-team-archive/engine/blob/main/tools/build_bucket_golden_scraper/README.md Install ImageMagick using Homebrew for enhanced image diffing capabilities with git. ```shell # On MacOS. $ brew install imagemagick ``` -------------------------------- ### Prepare Build Files for iOS Device Executables Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Use this command to prepare build files for device-side executables. Add `--simulator --unoptimized` for simulator builds. For arm64 Mac simulators, include `--simulator-cpu=arm64`. ```bash ./flutter/tools/gn --ios --unoptimized ``` -------------------------------- ### Create and Navigate to Engine Directory Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Setting-up-the-Engine-development-environment.md Create a new directory for the engine source code and change into it. ```sh mkdir engine; cd engine; ``` -------------------------------- ### Prepare Build Files and Build Binary Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/README.md Generate build files using the Flutter GN tool and then build the necessary binaries using Ninja. This step is crucial for creating the test artifacts. ```bash $ENGINE_DIR/flutter/tools/gn --fuchsia --no-lto ninja -C $ENGINE_DIR/out/fuchsia_debug_x64 flutter/shell/platform/fuchsia fuchsia_tests ``` -------------------------------- ### Install Emulator Component Source: https://github.com/flutter-team-archive/engine/blob/main/testing/scenario_app/android/README.md Update the vendored Android emulator to resolve known issues, such as problems with Vulkan. This command installs the latest emulator version using the sdkmanager. ```sh $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install emulator ``` -------------------------------- ### Compile Schemas with glib-compile-schemas Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/linux/testing/gschemas/README.md Download the gsettings-desktop-schemas package, extract its contents, and then compile the schemas using `glib-compile-schemas`. Ensure the target directory is correctly specified. ```bash # download gsettings-desktop-schemas package wget http://archive.ubuntu.com/ubuntu/pool/main/g/gsettings-desktop-schemas/gsettings-desktop-schemas_.deb # extract schema sources (/usr/share/glib-2.0/schemas/*.gschema.xml & .override) ar x gsettings-desktop-schemas_.deb tar xf data.tar.zst # compile schemas (/usr/share/glib-2.0/schemas/gschemas.compiled) glib-compile-schemas --targetdir path/to/testing/gschemas usr/share/glib-2.0/schemas/ ``` -------------------------------- ### List Available Builds with et Source: https://github.com/flutter-team-archive/engine/blob/main/docs/rbe/rbe.md View all available build configurations for the `et` tool. Use the `--verbose` flag to see builds that match CI configurations. ```bash et help build --verbose ``` -------------------------------- ### Get Thread Backtrace in LLDB Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Crashes.md Command to get the current thread's backtrace in LLDB. Assumes you are on the crashed thread; if not, use 'thread select n' first. ```bash thread backtrace ``` -------------------------------- ### Build and Run Android Display List Benchmarks Source: https://github.com/flutter-team-archive/engine/blob/main/testing/benchmark/README_displaylist.md Build the display_list_benchmarks binary for Android and push it to the device using adb. The binary is then executed via adb shell, with results piped to a JSON file. Ensure the binary is placed on a non-exec mount point like /data/local/tmp. ```bash $ adb push out/android_profile_arm64/display_list_benchmarks /data/local/tmp/display_list_benchmarks $ adb shell /data/local/tmp/display_list_benchmarks --benchmark_format=json | tee android-results.json ``` -------------------------------- ### Install cquery or ccls via Homebrew Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Setting-up-the-Engine-development-environment.md Installs the cquery or ccls language server on macOS using Homebrew. These tools provide advanced IDE features for C/C++/Objective-C development. ```shell brew install cquery # or brew install ccls ``` -------------------------------- ### Initialize SkiaGoldClient Source: https://github.com/flutter-team-archive/engine/blob/main/testing/skia_gold_client/README.md Initializes the SkiaGoldClient with a working directory and authenticates it. Ensure to clean up the temporary directory afterwards. ```dart import 'dart:io' as io; import 'package:skia_gold_client/skia_gold_client.dart'; void main() async { // Create a temporary working directory. final io.Directory tmpDirectory = io.Directory.systemTemp.createTempSync('skia_gold_wd'); try { final SkiaGoldClient client = SkiaGoldClient(tmpDirectory); await client.auth(); // ... } finally { tmpDirectory.deleteSync(recursive: true); } } ``` -------------------------------- ### Initialize Google Cloud Project Source: https://github.com/flutter-team-archive/engine/blob/main/docs/rbe/rbe.md Initialize the gcloud SDK with the correct project ID for RBE. Ensure the gcloud tool is on your PATH. ```bash gcloud init --project flutter-rbe-prod ``` -------------------------------- ### Prepare Build Files and Build Binary Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/README.md Configures the build using GN and compiles the necessary binaries for the Dart AOT runner integration tests. ```bash $ENGINE_DIR/flutter/tools/gn --fuchsia --no-lto --runtime-mode=profile ninja -C $ENGINE_DIR/out/fuchsia_profile_x64 flutter/shell/platform/fuchsia fuchsia_tests ``` -------------------------------- ### Run Android Tests Source: https://github.com/flutter-team-archive/engine/blob/main/testing/scenario_app/android/README.md Execute the test runner script to install and run tests on a connected device or emulator. This script handles test app installation, test execution, and result reporting. ```sh dart ./testing/scenario_app/bin/run_android_tests.dart ``` -------------------------------- ### Generate Fuchsia Build Files Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Use the 'gn' tool to generate build files for Fuchsia. Specify '--fuchsia-cpu' for different architectures and '--runtime-mode' for release or profile builds. Omit '--no-lto' to enable link-time optimization. ```bash ./flutter/tools/gn --fuchsia --no-lto ``` -------------------------------- ### Download Licenses with Gradle Source: https://github.com/flutter-team-archive/engine/blob/main/tools/cipd/android_embedding_bundle/README.md Fetches license information for the project's dependencies. ```bash gradle downloadLicenses ``` -------------------------------- ### Example Gradle Dependency Error Source: https://github.com/flutter-team-archive/engine/blob/main/testing/scenario_app/android/README.md This error message indicates that the dependency lockfile is out of date and needs to be updated. ```txt FAILED: scenario_app/reports/lint-results.xml vpython3 ../../flutter/testing/rules/run_gradle.py /b/s/w/ir/cache/builder/src/flutter/testing/scenario_app/android lint --no-daemon -Pflutter_jar=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/flutter.jar -Pout_dir=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/scenario_app --project-cache-dir=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/scenario_app/.gradle --gradle-user-home=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/scenario_app/.gradle FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugAarMetadata'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Resolved 'org.hamcrest:hamcrest-core:1.3' which is not part of the dependency lock state > Resolved 'com.google.code.findbugs:jsr305:2.0.2' which is not part of the dependency lock state ``` -------------------------------- ### Build Unoptimized Binary (macOS/Linux) Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Compile a desktop unoptimized binary using ninja. If --unoptimized was not used, build with 'ninja -C out/host_debug'. ```bash ninja -C out/host_debug_unopt ``` -------------------------------- ### Testing with MockGLES Source: https://github.com/flutter-team-archive/engine/blob/main/impeller/renderer/backend/gles/test/README.md Demonstrates how to create a mock GLES implementation, interact with its procedure table, and inspect captured calls for testing. ```cc TEST(MockGLES, Example) { // Creates a mock GLES implementation and sets it as the current one. auto mock_gles = MockGLES::Init(); auto& gl = mock_gles->GetProcTable(); // Call the proc table methods as usual, or pass the proc table to a class // that needs it. gl.PushDebugGroupKHR(GL_DEBUG_SOURCE_APPLICATION_KHR, 0, -1, "test"); gl.PopDebugGroupKHR(); // Method names are recorded and can be inspected. // // Note that many built-ins, like glGetString, are not recorded (otherwise the // logs would be much bigger and less useful). auto calls = mock_gles->GetCapturedCalls(); EXPECT_EQ(calls, std::vector( {"PushDebugGroupKHR", "PopDebugGroupKHR"})); } ``` -------------------------------- ### Build iOS Display List Benchmarks Source: https://github.com/flutter-team-archive/engine/blob/main/testing/benchmark/README_displaylist.md Build the dylib containing the benchmarking code for iOS. This is not built by default and requires specifying the target manually. ```bash $ ninja -C out/ios_profile ios_display_list_benchmarks ``` -------------------------------- ### Update VSCode Workspace Configuration Source: https://github.com/flutter-team-archive/engine/blob/main/tools/vscode_workspace/README.md Run this script to update the `//engine.code-workspace` file. Ensure necessary tools are installed. ```shell ./refresh.sh ``` -------------------------------- ### Build Binary (Windows) Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Compile the engine using ninja, specifying the output directory. For non-debug configurations, you can build gen_snapshot specifically. ```bash ninja -C .\out\ ``` ```bash ninja -C .\out\ gen_snapshot ``` -------------------------------- ### Prepare Build Files with gn Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Generate build files using the 'gn' tool with unoptimized and full Dart SDK flags. This prepares the engine for compilation. ```bash python .\flutter\tools\gn --unoptimized --full-dart-sdk ``` -------------------------------- ### Update Chrome for Testing Version Source: https://github.com/flutter-team-archive/engine/blob/main/lib/web_ui/README.md Manually update the Chrome for Testing version in `dev/package_lock.yaml`. Ensure `depot_tools` is installed and you are authenticated with CIPD. ```yaml - "chrome" version: "118.0.5993.70" ``` -------------------------------- ### Get Display Refresh Rate Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Engine-specific-Service-Protocol-extensions.md Retrieves the display refresh rate of the device running the Flutter view. Requires a viewId as an argument. ```text viewId = _flutterView/0x15bf057f8 ``` ```json { "type": "DisplayRefreshRate", "fps": 60.0 } ``` -------------------------------- ### Prepare Android Build Files with gn Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Use the `gn` tool to configure build files for Android targets. Specify CPU architecture and optimization level as needed. ```bash ./flutter/tools/gn --android --unoptimized ``` ```bash ./flutter/tools/gn --android --android-cpu arm64 --unoptimized ``` ```bash ./flutter/tools/gn --android --android-cpu x86 --unoptimized ``` ```bash ./flutter/tools/gn --android --android-cpu x64 --unoptimized ``` ```bash ./flutter/tools/gn --unoptimized ``` ```bash ./flutter/tools/gn --unoptimized --mac-cpu arm64 ``` -------------------------------- ### Run Impeller Golden Tests Source: https://github.com/flutter-team-archive/engine/blob/main/impeller/golden_tests/README.md Example invocation for running the Impeller golden tests. This script is used to generate golden images for testing. ```sh ./run_tests.py --variant="host_debug_unopt_arm64" --type="impeller-golden" ``` -------------------------------- ### Sample Sanitizer Suppressions Output Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Using-Sanitizers-with-the-Flutter-Engine.md This is an example of the output you might see after sourcing the sanitizer suppressions script, indicating which suppression files are being used. ```text Using Thread Sanitizer suppressions in ./flutter/testing/tsan_suppressions.txt Using Leak Sanitizer suppressions in ./flutter/testing/lsan_suppressions.txt ``` -------------------------------- ### Build Fuchsia OS Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/fuchsia/flutter/tests/integration/touch-input/README.md These commands are used to configure and build the Fuchsia operating system for the terminal environment. Ensure you have the necessary build tools installed. ```shell fx set terminal.qemu-x64 && fx build ``` -------------------------------- ### DDS Command-Line Interface Help Source: https://github.com/flutter-team-archive/engine/blob/main/docs/Using-the-Dart-Development-Service-(DDS)-and-Flutter-DevTools-with-a-custom-Flutter-Engine-Embedding.md Displays the available options for configuring the Dart Development Service when using the `dart development-service` command. The `--vm-service-uri` is mandatory. ```bash Start Dart's development service. Usage: dart [vm-options] development-service [arguments] -h, --help Print this usage information. --vm-service-uri= (mandatory) The VM service URI DDS will connect to. --bind-address=
The address DDS should bind to. (defaults to "localhost") --bind-port= The port DDS should be served on. (defaults to "0") --[no-]disable-service-auth-codes Disables authentication codes. --[no-]serve-devtools If provided, DDS will serve DevTools. If not specified, "--devtools-server-address" is ignored. --devtools-server-address Redirect to an existing DevTools server. Ignored if "--serve-devtools" is not specified. --[no-]enable-service-port-fallback Bind to a random port if DDS fails to bind to the provided port. --cached-user-tags A set of UserTag names used to determine which CPU samples are cached by DDS. --google3-workspace-root Sets the Google3 workspace root used for google3:// URI resolution. Run "dart help" to see global options. ``` -------------------------------- ### Initialize LocaleKeymap Mapping Source: https://github.com/flutter-team-archive/engine/blob/main/third_party/web_locale_keymap/README.md Instantiate the `LocaleKeymap` with the appropriate platform-specific mapping. Use `.win()`, `.darwin()`, or `.linux()` based on the target operating system. ```dart import 'package:web_locale_keymap/web_locale_keymap.dart' as locale_keymap; final locale_keymap.LocaleKeymap mapping = locale_keymap.LocaleKeymap.win(); // Or .darwin() or .linux() ``` -------------------------------- ### Enable Log Output in Tests Source: https://github.com/flutter-team-archive/engine/blob/main/shell/platform/android/test/README.md To see log output from your tests in the console, import `org.robolectric.shadows.ShadowLog` and set `ShadowLog.stream = System.out;` in your test or setup method. ```java import org.robolectric.shadows.ShadowLog; // In your test or setup method: ShadowLog.stream = System.out; ``` -------------------------------- ### Specify Android Debug Unoptimized Build for clang-tidy Source: https://github.com/flutter-team-archive/engine/blob/main/tools/clang_tidy/README.md Example of running clang-tidy specifically on the `android_debug_unopt` build variant. This demonstrates the usage of the `--target-variant` flag. ```shell dart ./tools/clang_tidy/bin/main.dart --target-variant android_debug_unopt ``` -------------------------------- ### Update .ci.yaml for Apple Signing Source: https://github.com/flutter-team-archive/engine/blob/main/tools/cipd/mobileprovision/README.md Shows the before and after configuration for migrating 'apple_signing' steps in .ci.yaml to use a new version tag. ```yaml Before: {"dependency": "apple_signing", "version": "version:to_2024"} After: {"dependency": "apple_signing", "version": "version:to_2025"} ``` -------------------------------- ### Create Native Activity APK Source: https://github.com/flutter-team-archive/engine/blob/main/testing/android/native_activity/README.md Use `native_activity_apk` to build an APK for your executable. Specify the `apk_name`, `testonly` status, source files, and dependencies. ```gn native_activity_apk("apk_unittests") { apk_name = "toolkit_unittests" testonly = true sources = [ "toolkit_android_unittests.cc" ] deps = [ ":unittests_lib", "//flutter/testing/android/native_activity:gtest_activity", ] } ``` -------------------------------- ### Build specific test target with Ninja Source: https://github.com/flutter-team-archive/engine/blob/main/docs/testing/Testing-the-engine.md Manually invoke the ninja command if the `run_tests.py` script fails to build the test library, for example, if `libios_test_flutter.dylib` is missing. ```bash ninja -C $FLUTTER_ENGINE/out/ios_debug_sim_unopt_arm64 ios_test_flutter ``` -------------------------------- ### Configure Fuchsia Dependencies Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Update the .gclient file to enable downloading Fuchsia dependencies and running the emulator. 'run_fuchsia_emu' can be omitted if local tests are not required. ```python solutions = [ { # ... "custom_vars": { "download_fuchsia_deps": True, "run_fuchsia_emu": True, }, }, ] ``` -------------------------------- ### Configure Gclient Variables Source: https://github.com/flutter-team-archive/engine/blob/main/ci/builders/README.md Sets variables for the gclient sync operation, often used to manage dependencies. This example disables downloading Android SDK dependencies. ```json "gclient_variables": { "download_android_deps": false } ``` -------------------------------- ### Configure Visual Studio (Windows) Source: https://github.com/flutter-team-archive/engine/blob/main/docs/contributing/Compiling-the-engine.md Set environment variables to point depot tools at your Visual Studio installation. Ensure Python 2.7 is prioritized in your Path. ```powershell DEPOT_TOOLS_WIN_TOOLCHAIN=0 GYP_MSVS_OVERRIDE_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" # (or your location for Visual Studio) WINDOWSSDKDIR="C:\Program Files (x86)\Windows Kits\10" # (or your location for Windows Kits) ```