iOS 12 USB pairing with Anka VM for iOS CI

In iOS 12 the lockdown procedure (mutual authentication of USB host and iOS device on each other) was modified. This lockdown procedure affects the workflow of attaching iOS devices to Anka VMs with USB pass-through for iOS CI real device testing using Anka Build or Anka Flow.

We have fixed this issue in Anka version 1.4.3 and also determined that a specific set of instructions are required to pair iOS 12 device with the Anka VM Template and then it can be used in a fully automated manner as part of CI.

Step 1 – If the device in the past, was already connected to host (on which the VM is going to run), then remove host record from the device DB, i.e., make the device forget the host. Execute the following to do this.
  • Detach the device from the host
  • On the device, Select Settings -> General -> Reset -> Reset Network Settings.
  • Step 2 – Attach the device to host and “Don’t Trust” the host in the dialog box that appears on the Device.



    If a dialog box also appears on the host, don’t ‘trust’ the device on the host.



    Step 3 – In the terminal window on the host, claim the device with these commands.

    sudo anka usb list

    sudo anka sub claim -n ios12iphone iphone/location

    “-n” flag can be used to associate a name with the claimed device. You can claim multiple devices connected to the same host with the same name, thus creating a group(name).



    Step 4 – Attach the device to the VM.

    anka start -d iPhone VMNAME

    The trust dialog will appear again on the device. Click on ‘trust’ the VM.



    and allow access to the device in the VM (trust device)



    Now the VM and the device are paired and accessible in Xcode and iTunes. You could detach the device, suspend or stop the VM. Next sessions of the VM or its clones on any other host should silently connect the device without additional prompts.



    Important – To pair another iOS12 device or other VMs, repeat steps 2 – 5, and make sure to “Don’t Trust” host on which you are performing the pairing. Contact us in our slack channel with additional questions on how to use the real devices with Anka Build dynamically provisioned VMs.

    Announcing Anka Build version 1.4.3 – Supports Docker inside Anka VMs

    Anka Build and Anka Flow version 1.4.3 is now available for all users. Some key new features in version 1.4.3 of Anka include support to run Docker and other hypervisors inside Anka VMs, create groups/clusters in Anka Build macOS cloud, priority based provisioning and core-based licensing. For more details see the version 1.4.3 release notes here.

    Run hypervisors inside Anka VMs

    Starting version 1.4.3, you can run Docker and other hypervisors like Anka, Android Emulator inside an Anka VM. See documentation to enable this feature on existing or newly created Anka VMs.

    Anka VM running Android Emulator and VirtualBox hypervisors



    Create groups/clusters to run VMs on specific Anka Build nodes(Host machines)

    When your Anka Build host machines are a mix of different types, you can create groups of similar machine types and provision specific Anka VMs to execute certain iOS CI jobs on specific groups.

    Also, use groups/clusters feature to assign pre-determined capacity to different groups using the Anka Build iOS CI infrastructure.  Grouping and Priority based provisioning features are available in Anka Build Enterprise Tier.

    Groups



    Creating Groups



    Core Based Licensing

    Going forward, Anka Build licensing will be generated for total cores in Anka Build Cloud instead of total machines and machine types. This will make it easier to add/remove and manage license key across multiple machines.

    Machine/Host-based licensing will be supported until the expiration of subscription to maintain compatibility with existing user setup. Sign up at https://veertu.com/getting-started-anka-trials/ to try Anka for iOS and macOS CI. 

    Quick setup of Anka Build macOS cloud on Mac hardware

    In this blog post, we will discuss how you can very quickly set up a macOS cloud using Anka Build exclusively on Mac Hardware. Anka Build cloud management software component is packaged as Linux Docker containers, and most common implementation architecture is to run them on a Linux instance. However, if you don’t have access to a Linux instance, you can set up a test/POC environment for Anka Build all on Mac hardware. The Mac hardware can be a single Mac machine (your MBP) or a cluster of Mac machines. We recommend this setup for quick proof of concept purposes, but you can use it for small-scale iOS CI operations.

    Setup on a single Mac machine

    Anka Build runs on all Mac hardware, including the latest 6-core 2018 mac minis. Follow these steps to get started.
  • Step 1 – Download Anka Build and Anka Build Controller and Registry for Mac packages from the Anka Build download page after trial registration. Note – Make sure there is enough free space on the Mac machine (at least 60GB).
  • Step 2 – Install AnkaBuild.pkg mac application on the Mac. https://ankadoc.bitbucket.io/getting-started/#anka-package-installation-and-upgrade-on-mac-hardware
  • Step 3 – Install the anka-controller-registry-mac-X.X.XX package. This package contains the management pieces of Anka Build macOS Cloud software. The controller gets installed as a docker container and registry is installed as a Mac application, Follow the instructions under Mac installation in https://ankadoc.bitbucket.io/getting-started/#registry-and-controller-installation-and-upgrade
  • Step 4 – Join the AnkaBuild node to Controller using ankacluster join command. https://ankadoc.bitbucket.io/using-controller/. For controller-address[:port], you will use http://localhost:8090.
  • Step 5 – Create your macOS VM template on the mac machine using AnkaBuild CLI. https://ankadoc.bitbucket.io/creating-vms/#using-macos-installer-application-recommended-to-create-mojave-hisierra-sierra-vms.
  • Step 6 – Connect the mac machine to the Registry using anka registry add [OPTIONS] REG_NAME REG_URL command. https://ankadoc.bitbucket.io/using-registry/#adding-a-new-registry. For REG_URL, you will specify the IP of your Mac. It’s the same value that you specified in step 3 in anka-controller. Docker file ENV REGISTRY_ADDR variable.
  • Step 7 – Push your macOS VM template to the registry using anka registry push command. https://ankadoc.bitbucket.io/using-registry/#pushing-vms-to-registry
  • Step 8 – You will now see this VM template under templates in Controller Portal dashboard.
  • You have now completed the setup of a single node macOS cloud and have one macOS VM template that you can use to provision on-demand VMs.
  • Step 9 – Go to Instances page on the portal dashboard and test using “Create Instances”.


  • Setup on Multiple Mac machines

    In this setup, it assumed that you want to set up a multi-node Anka Build macOS cloud. You will install the AnkaBuild package on all the Mac machines.

    Install the anka-controller-registry-mac-X.X.XX package on only one Mac machine, where you want to run the cloud management services. Follow the same instructions as Step3 outlined in the earlier section. Install the anka-controller-registry-mac-X.X.XX package on only one Mac machine, where you want to run the cloud management services. Follow the same instructions as Step3 outlined in the earlier section.

    Join all the Mac machines running AnkaBuild package to the Controller to create a multi-node cloud.

    Select one of the Mac machines to create VM templates from the nodes and execute steps 5.6.7 from the earlier section.

    You should now see multiple nodes in the portal dashboard.

    For additional questions, you can join the slack channel at https://slack.veertu.com/.