Using Anka Build to run your Android project’s CI/CD

android-on-host-example

Using Anka Build to run your Android project’s CI/CD builds and tests is a relatively simple process. However, time after time, we hear the same concerns from our customers about emulators not working or having poor performance. This is understandable as, at the time of writing this blog, we’re still working on supporting the use of the host GPU and Metal APIs inside Anka VMs. Running your emulators using CPU is possible but has limited performance.

Therefore, we’d like to show you how to run your project’s build and unit tests inside of an Anka VM, then pass the project to the host to run your emulator tests. We’ve created an example repo for you to review at https://github.com/veertuinc/android-emulator-on-host-example



Repository Overview

  • The base of the project is from android’s testing samples repo.
  • The GitHub Action workflow file includes the commands used to run your Android build and tests both inside of the VM and out on the host.
  • The vm-watcher.bash example script helps us run a detached process on the host that waits for the VM to be deleted (happens when the job completes/fails/is canceled) and then cleans up the emulator that we also ran detached on the host.

Veertu’s Anka Build Virtualization software has come a long way since our announcement in 2017. We’ve been consistently adding the most customer-requested features and keeping our software up to date and compatible with the latest Apple macOS releases. GPU and Metal support is one of the features we’re excited to add in the future, but until then, we know this pattern of using Anka Build to run your Android project’s CI/CD will suffice.

If you’re new to Anka software, you can get started by signing up for a trial on our site: https://veertu.com/getting-started-anka-trials/