Installation
Install Patrol CLI globally using Dart’s pub:Make sure the Dart pub global bin directory is in your PATH. On macOS/Linux, this is typically
~/.pub-cache/bin.Quick Start
After installing the CLI, you can start using Patrol in your Flutter project:Complete native setup
Follow the native setup guide to configure Android and iOS.
Core Commands
Patrol CLI provides several commands to help you throughout the testing lifecycle:Testing Commands
- patrol test - Run integration tests on devices
- patrol develop - Develop tests with Hot Restart
- patrol build - Build app binaries for testing
Utility Commands
- patrol devices - List available devices and simulators
- patrol doctor - Check installation and environment
- patrol update - Update CLI to the latest version
Key Features
Advanced Test Bundling
Patrol automatically bundles all your tests into a single app binary, which means:- Only one build is required for all tests
- Faster CI/CD pipelines
- Better isolation between test runs
- Support for parallel test execution
Hot Restart Support
Withpatrol develop, you can iterate quickly on your tests:
- No need to rebuild after code changes
- Press ‘R’ to restart tests instantly
- Works on Android and iOS simulators
Multi-Platform Support
Run your tests across platforms:- Android devices and emulators
- iOS devices and simulators
- macOS desktop
- Web browsers (via Playwright)
Native Integration
Patrol deeply integrates with native testing frameworks:- Uses Gradle and Android Test Orchestrator on Android
- Uses XCTest and xcodebuild on iOS
- Proper native test output and reporting
Common Workflows
Running all tests
Running a specific test file
Running tests with tags
Developing with Hot Restart
Building for CI/CD
Getting Help
For detailed information about any command, use the--help flag:
Environment Configuration
Flutter Command
By default, Patrol uses theflutter command from your PATH. You can customize this:
Configuration in pubspec.yaml
You can configure Patrol’s behavior in yourpubspec.yaml:
Next Steps
Test Command
Learn how to run tests with patrol test
Develop Command
Speed up test development with Hot Restart
Build Command
Build test binaries for CI/CD
Full Documentation
Read the complete Patrol documentation
Troubleshooting
If you encounter issues:- Run
patrol doctorto check your environment - Check the documentation for setup guides
- Search or create issues on GitHub
- Join the discussion on Discord