Getting started
Installationโ
Install the CLI with:
- macOS/Linux
- Windows
curl https://get.flashlight.dev | bash
On a macOS with arm64 architecture (Silicon), you'll need to install Rosetta if you don't have it:
softwareupdate --install-rosetta --agree-to-license
More details here
iwr https://get.flashlight.dev/windows -useb | iex
1. Run the test commandโ
If you have an e2e test script, you can run:
flashlight test --bundleId <your app bundle id> \
--testCommand <your e2e test command> \
--duration 10000 \
--resultsFilePath results.json
- This will run your e2e test 10 times (by default), measure performance during 10s for each iteration and write measures to
results.json
- Use
flashlight tools android_get_bundle_id
to display the bundle id of the app opened on your phone - โ ๏ธ If your e2e test doesn't start the app, add
--skipRestart
to theflashlight test
command
Example: quickly measure startup performanceโ
Using adb shell
you can start the app with adb shell monkey -p <bundleid> -c android.intent.category.LAUNCHER 1
You can just pass this to flashlight test
, for instance, measure startup performance of the Twitter app with:
flashlight test --bundleId "com.twitter.android" \
--testCommand "adb shell monkey -p com.twitter.android -c android.intent.category.LAUNCHER 1" \
--duration 10000
Going furtherโ
You'll notice in the previous example that the "Average Test runtime" metric will not give you a proper Time To Interactive metric.
To go further, use a proper e2e testing framework (Appium, Detox, Maestro...).
If you're not using one yet, we recommend to use Maestro! Check out our Maestro guide to get started quickly with Flashlight and Maestro.
You can also check the full command options here
2. Open the web reportโ
You can then open the web report for those measures:
flashlight report results.json