-
Notifications
You must be signed in to change notification settings - Fork 41
/
entrypoint.sh
28 lines (24 loc) · 1.15 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#set -e
export QTWEBENGINE_DISABLE_SANDBOX=1
# Create the kvm node (required --privileged)
if [ ! -e /dev/kvm ]; then
mknod /dev/kvm c 10 $(grep '\<kvm\>' /proc/misc | cut -f 1 -d' ')
fi
# Create Pixel AVD, if it doesn't already exist
${ANDROID_HOME}/tools/bin/avdmanager list avd | grep 'Pixel' &> /dev/null
if ! [ $? == 0 ]; then
echo "Creating Pixel AVD..."
echo no | ${ANDROID_HOME}/tools/bin/avdmanager create avd -n Pixel -k "system-images;android-26;google_apis;x86" -c 2000M \
&& echo 'hw.keyboard=yes' >> /root/.android/avd/Pixel.avd/config.ini # enable hardware keyboard input
else
echo "Pixel AVD already exists"
fi
# Start Android emulator and install WhatsApp
# See https://github.com/fcwu/docker-ubuntu-vnc-desktop/blob/master/image/etc/supervisor/conf.d/supervisord.conf
export ANDROID_AVD_HOME=/root/.android/avd ANDROID_SDK_HOME=/root/.android HOME=/root DISPLAY=:1.0 \
&& xhost +local:docker \
&& xhost +local:root \
&& rm -f $ANDROID_AVD_HOME/Pixel.avd/hardware-qemu.ini.lock \
&& ${ANDROID_HOME}/tools/emulator @Pixel -gpu off -no-boot-anim -snapstorage /app/snapshots \
&& adb install /app/whatsapp.apk