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/

Upgrading to Big Sur Beta in your Anka Build VM

big-sur-beta-window

We are excited to share a patch for our Anka Build Virtualization (v2.2.3) software that supports upgrading to Big Sur Beta in your Anka Build VM. Upgrading to Big Sur Beta is relatively easy and can be done using the standard beta installation process you would expect.

We highly suggest that you avoid patching/testing on your production servers
Our testing at the time of writing this is with Big Sur beta2. It’s possible that other beta releases of Big Sur will not work with our patch.
  1. Install our Big Sur beta patch on an Anka Build Virtualization Node running version 2.2.3.
  2. Ensure your VM Template/Tag has enough disk space to handle the Big Sur beta downloaded installer:
    • anka modify {TemplateName} set hard-drive -s ##GB && anka run -n {TemplateName} diskutil apfs resizeContainer disk1 0
  3. Start your VM with anka start {TemplateName} and then launch the Anka viewer with anka view {TemplateName}. Alternatively, you can VNC into the running VM.
  4. Enroll in the Apple Beta Software Program and follow their instructions to download the Big Sur installer inside of your Anka VM.
  5. Proceed with the normal upgrade process to Big Sur beta.
    • The upgrade process reboots the VM and can potentially get stuck on a black screen. When this happens, stop the VM with Anka command line anka stop {TemplateName} and start it again with anka start -v {TemplateName}.

At this point, you should now have an Anka VM running a beta version of Big Sur. Unfortunately, upgrading to Big Sur Beta doesn’t guarantee that all features will be functioning as expected as Big Sur, and Anka support for it, are in flux. We are continuing to work on General Availability (GA) support of Big Sur.

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/