Running Android Instrumentation Tests on Circle CI Without a Third Party Service
Article Summary
Doğu Deniz Uğur challenges CircleCI's own documentation. While the official docs say Android emulator tests aren't supported on their Linux VMs, he found a workaround that eliminates the need for Firebase Test Lab or other third-party services.
CircleCI excels at iOS testing but officially doesn't support Android emulator tests on Linux. The standard advice? Pay for Firebase Test Lab. But there's a hidden alternative: CircleCI's macOS environment can be configured to run Android instrumentation tests directly, just like your local machine.
Key Takeaways
- Use CircleCI's macOS environment instead of Linux to run Android emulators
- Cache Android SDKs and emulator files to dramatically reduce execution time
- Combine Fastlane automation with CircleCI config for seamless test execution
- Download Android SDK via Homebrew, then start emulator before running tests
You can run Android instrumentation tests directly on CircleCI without paying for third-party services by leveraging their macOS environment with proper caching and Fastlane integration.
About This Article
CircleCI's documentation says Android emulators don't work on Linux VMs. This means developers have to use expensive third-party services like Firebase Test Lab to run instrumentation tests.
Doğu Deniz Uğur set up CircleCI's macOS environment with Android SDKs installed via Homebrew, downloaded the emulator, and used Fastlane to run ./gradlew commands directly. No external services needed.
With caching for Android SDKs and emulator files, builds run faster on subsequent commits. The team also stopped paying for Firebase Test Lab in their CI pipeline.