title: Travis CI Android Tests: no connected devices
body: <p>I am trying to set up Travis for Android. Running the build seems to work so far, but when it comes to the tests, it complains about "No connected devices!"</p>
  
  <pre><code>:app:connectedAndroidTestDebug FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:connectedAndroidTestDebug'.
  &gt; com.android.builder.testing.api.DeviceException: java.lang.RuntimeException: 
      No connected devices!
  </code></pre>
  
  <p>Here is my .travis.yml, and from what I understand, I am creating and starting an emulator for the tests, just the way as the <a href="http://docs.travis-ci.com/user/languages/android/#How-to-Create-and-Start-an-Emulator">documentation</a> says.</p>
  
  <pre><code>language: android
  android:
    components:
      # Uncomment the lines below if you want to
      # use the latest revision of Android SDK Tools
      # - platform-tools
      # - tools
  
      # The BuildTools version used by your project
      - build-tools-22.0.1
  
      # The SDK version used to compile your project
      - android-22
  
      # Additional components
      - extra-google-google_play_services
      - extra-google-m2repository
      - extra-android-m2repository
      # - addon-google_apis-google-19
      # - add-on
      # - extra
  
      # Specify at least one system image,
      # if you need to run emulator(s) during your tests
      - sys-img-armeabi-v7a-android-22
      # - sys-img-x86-android-17
  
    licenses:
      - 'android-sdk-license-.+'
  
    # Emulator Management: Create, Start and Wait
    before_script:
      - echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
      - emulator -avd test -no-skin -no-audio -no-window &amp;
      - android-wait-for-emulator
      - adb shell input keyevent 82 &amp;
  </code></pre>
  
  <p>Can you tell me what I'm doing wrong and how to fix it?</p>