Connected2.me Aug 26, 2019

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

Critical Insight

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.

The article includes a complete reference implementation and config files you can adapt immediately for your own Android CI pipeline.

About This Article

Problem

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.

Solution

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.

Impact

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.

Recent from Connected2.me

Related Articles