A sylph is a mythological invisible being of the air. Wikipedia
Sylph is a command line utility for running Flutter integration and end-to-end tests on pools of real iOS and Android devices in the cloud. Sylph runs on a developer mac or in a CI environment.
pub global activate sylph
or, if not using the default config file:
sylph -c <path to config file>
usage: sylph [--help] [--config <config file>] [--devices <all|android|ios>] sample usage: sylph -c, --config=<sylph.yaml> Path to config file. (defaults to "sylph.yaml") -d, --devices=<all|android|ios> List availabe devices. [all, android, ios] --help Display this help information.
Install AWS Command Line Interface (AWS CLI)
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
For alternative install options see:
Configure the AWS CLI credentials:
$ aws configure AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Default region name [None]: us-west-2 Default output format [None]: json
For alternative configuration options see:
Configuration information is passed to Sylph using a configuration file. The default config file is called
# Config file for Flutter tests on real device pools. # Auto-creates projects and device pools if needed. # Configures android and ios test runs. # Builds app, uploads and runs tests. # Then monitors tests, returns final pass/fail result and downloads artifacts. # Note: assumes the 'aws' command line utility is logged-in. # Note: to build the debug iOS app, certain environment variables are required. # sylph config tmp_dir: /tmp/sylph artifacts_dir: /tmp/sylph_artifacts # local timeout per device farm run sylph_timeout: 720 # seconds approx # run on ios and android pools concurrently (for faster results) concurrent_runs: true # device farm config project_name: test concurrent runs default_job_timeout: 10 # minutes, set at project creation device_pools: - pool_name: android pool 1 pool_type: android devices: - name: Google Pixel 2 model: Google Pixel 2 os: 8.0.0 - pool_name: ios pool 1 pool_type: ios devices: - name: Apple iPhone X model: A1865 os: 11.4 test_suites: - test_suite: example tests 1 main: test_driver/main.dart tests: - test_driver/main_test.dart pool_names: - android pool 1 - ios pool 1 job_timeout: 15 # minutes, set per job, over-rides default job timeout above
Multiple test suites, consisting of multiple tests, can be run on each device in each device pool. The 'main' app must include a call to
Device pools can consist of multiple devices. Devices in a device pool must be of the same type, iOS or Android.
To build a testable iOS app locally, that can run on any real device in the cloud, the following environment variables must be present:
A check is made before the start of a run to confirm these environment variables are present.
To add devices to a device pool, pick devices from the list provided by
sylph -d android or sylph -d ios
and add to the appropriate pool type in sylph.yaml. The listed devices are devices currently available on Device Farm.
The sylph.yaml is validated to confirm the devices are available on Device Farm and tests are present before starting a run. Presence of the required environment variables for the iOS build are also confirmed.
Special handling for building iOS apps is required for running tests on remote real devices. In particular, provisioning profiles and certificates must be installed on the build machine. To install the dependencies needed to complete the iOS build, Fastlane's match is used. Sylph will detect it is running in a CI environment (using the CI environment variable), and will install fastlane files that in turn will install the dependencies needed to build the iOS app using Fastlane's match. The iOS build can then complete as normal.
The following environment variables are required by a CI build to build the iOS app:
For details on how to configure Match see:
The following are required by sylph in a CI environment to connect to the match host. The match host is running the ssh server that connects to the git server which serves the match repo. This configuration is required so that PUBLISHING_MATCH_CERTIFICATE_REPO will work via ssh:
The following environment variables are also required by Sylph in a CI environment to configure the Fastlane Appfile and exportOptions.plist correctly:
The following AWS CLI credentials are required:
For details on other credentials see:
Note: the Travis-CI build uses pre-configured AWS CLI values in .aws/config
For example, when Sylph is run on Travis-CI the following environment variables are used:
To upgrade, simply re-issue the install command
$ pub global activate sylph
To check the version of Sylph currently installed:
pub global list
To see Sylph in action in a CI environment, a demo of the example app is available.
The log of the live run is here:
The resulting artifacts are here:
(includes a video of test running on device)
When contributing to this repository, please feel free to discuss via issue or pull request.
Your feedback is used to guide where development effort is focused. So feel free to create as many issues and pull requests as you want. You should expect a timely and considered response.
A new Flutter project.
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
You can install the package from the command line:
$ pub global activate sylph
The package has the following executables:
Add this to your package's pubspec.yaml file:
dependencies: sylph: ^0.4.0
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
|Dart SDK||>=2.0.0 <3.0.0|