Skip to content

Commit e21a000

Browse files
committed
Emulator config
1 parent 57688bc commit e21a000

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

circle.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
machine:
22
environment:
3-
ANDROID_HOME: /usr/local/android-sdk-linux
3+
ANDROID_HOME: /home/ubuntu/android
44
java:
55
version: oraclejdk8
66

77
dependencies:
88
pre:
99
- echo y | android update sdk --no-ui --all --filter "android-21,build-tools-21.1.1"
1010

11+
cache_directories:
12+
- ~/.android
13+
- ~/android
14+
1115
override:
16+
- ./install-dependencies.sh
1217
- ./gradlew dependencies
1318

1419
test:
1520
override:
16-
- ./gradlew build
21+
- $ANDROID_HOME/tools/emulator -avd testing -no-window -no-boot-anim -no-audio:
22+
background: true
23+
parallel: true
24+
- ./wait.sh:
25+
parallel: true
26+
- ./gradlew mvp-test:build mvp-test:jacocoTestReport app:connectedAndroidTest --stacktrace

install-dependencies.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Fix the CircleCI path
4+
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH"
5+
6+
DEPS="$ANDROID_HOME/installed-dependencies"
7+
8+
if [ ! -e $DEPS ]; then
9+
cp -r /usr/local/android-sdk-linux $ANDROID_HOME &&
10+
echo y | android update sdk -u -a -t android-21 &&
11+
echo y | android update sdk -u -a -t platform-tools &&
12+
echo y | android update sdk -u -a -t build-tools-21.1.1 &&
13+
echo y | android update sdk -u -a -t sys-img-x86-android-18 &&
14+
echo n | android create avd -n testing -f -t android-18 &&
15+
touch $DEPS
16+
fi

wait.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH"
4+
5+
while true; do
6+
BOOTUP=$(adb shell getprop init.svc.bootanim | grep -oe '[a-z]\+')
7+
if [[ "$BOOTUP" = "stopped" ]]; then
8+
break
9+
fi
10+
11+
echo "Got: '$BOOTUP', waiting for 'stopped'"
12+
sleep 5
13+
done

0 commit comments

Comments
 (0)