title: Trying to run a CI server with an emulator
body: <p>Has anyone managed to build a stable CI server with an emulator? I've spent most of yesterday on it.
  I'm using GitLab CI on a Docker container running on Core OS inside VirtualBox, inside Windows 8.1. Right now the emulator does not start and gives me no obvious message. When I try to run tests it simply tells me that there are no running devices.
  My current script does this:</p>
  
  <pre><code>- echo yes | android update sdk -a --no-ui --filter android-22
  - echo yes | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-google_apis-22
  - echo no | android create avd --name test -t 1 -c 1000M --abi "google_apis/armeabi-v7a" --force
  - emulator -avd test -partition-size 2000 -no-skin -no-audio -no-window -force-32bit &amp;
  </code></pre>
  
  <p>Lastly I run</p>
  
  <pre><code>- ./gradlew :breathcount:connectedBetaDebugAndroidTest
  </code></pre>
  
  <p>it just tells me that no devices are available, so I added something I found on SO in five minutes.</p>
  
  <pre><code>#!/bin/bash
  
  adb wait-for-device
  
  A=$(adb shell getprop sys.boot_completed | tr -d '\r')
  
  while [ "$A" != "1" ]; do
      sleep 2
      A=$(adb shell getprop sys.boot_completed | tr -d '\r')
  done
  
  adb shell input keyevent 82
  </code></pre>
  
  <p>This just waits for 20 minutes and no device was found.
  Right now I'm considering forwarding the ADB port into Docker and running the emulator directly on the machine. VMs all the way down might be the issue.</p>