machine:
  environment:
    ANDROID_BUILD_TOOLS: 24.0.1
    ANDROID_PLATFORM: 24

dependencies:
  pre:
    - if [ ! -e $ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS ]; then echo y | android update sdk --no-ui --all --filter build-tools-$ANDROID_BUILD_TOOLS; fi
    - if [ ! -e $ANDROID_HOME/platforms/android-$ANDROID_PLATFORM ]; then echo y | android update sdk --no-ui --all --filter "android-$ANDROID_PLATFORM"; fi

  cache_directories:
    - "${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}"
    - "${ANDROID_HOME}/platforms/android-${ANDROID_PLATFORM}"
    - "${ANDROID_HOME}/tools}"

test:
  pre:
    - emulator -avd circleci-android23 -no-audio -no-window:
                background: true
                parallel: true
    - circle-android wait-for-boot

  override:
    - ./gradlew lint test assembleDebug countDebugDexMethods -PdisablePreDex
    - ./gradlew spoon

  post:
    - mkdir $CIRCLE_TEST_REPORTS/dexcount
    - cp -r app/build/outputs/dexcount/debugChart/* $CIRCLE_TEST_REPORTS/dexcount
    - mkdir $CIRCLE_TEST_REPORTS/lint
    - cp app/build/outputs/lint-results-debug.html $CIRCLE_TEST_REPORTS/lint
    - mkdir $CIRCLE_TEST_REPORTS/spoon
    - cp -r app/build/spoon/debug $CIRCLE_TEST_REPORTS/spoon

machine:
  environment:
    ANDROID_BUILD_TOOLS: 24.0.1
    ANDROID_PLATFORM: 24

dependencies:
  pre:
    - if [ ! -e $ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS ]; then echo y | android update sdk --no-ui --all --filter build-tools-$ANDROID_BUILD_TOOLS; fi
    - if [ ! -e $ANDROID_HOME/platforms/android-$ANDROID_PLATFORM ]; then echo y | android update sdk --no-ui --all --filter "android-$ANDROID_PLATFORM"; fi

  cache_directories:
    - "${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}"
    - "${ANDROID_HOME}/platforms/android-${ANDROID_PLATFORM}"
    - "${ANDROID_HOME}/tools}"

test:
  pre:
    - emulator -avd circleci-android23 -no-audio -no-window:
                background: true
                parallel: true
    - circle-android wait-for-boot
    - adb shell input keyevent 82

  override:
    - ./gradlew lint test assembleDebug countDebugDexMethods -PdisablePreDex
    - ./gradlew spoon

  post:
    - mkdir $CIRCLE_TEST_REPORTS/dexcount
    - cp -r app/build/outputs/dexcount/debugChart/* $CIRCLE_TEST_REPORTS/dexcount
    - mkdir $CIRCLE_TEST_REPORTS/lint
    - cp app/build/outputs/lint-results-debug.html $CIRCLE_TEST_REPORTS/lint
    - mkdir $CIRCLE_TEST_REPORTS/spoon
    - cp -r app/build/spoon/debug $CIRCLE_TEST_REPORTS/spoon

Add menu button press to ensure the device is on home screen
Add menu button press to ensure the device is on home screen
