Skip to content

Instantly share code, notes, and snippets.



Created Aug 18, 2016
What would you like to do?
Dockerfile for Build and CI of Android Projects - Included: fb-adb command, disabling system animation
FROM java:8
MAINTAINER Masanori Ohgita
# NOTE: This Dockerfile was forked from following projects.
# - Modified by Ohgita on denLabo LLC
# - Authored by FUJI Goro (MIT License)
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -yq libc6:i386 libstdc++6:i386 zlib1g:i386 libncurses5:i386 \
build-essential g++ unzip vim-common libssl-dev python-openssl --no-install-recommends && \
apt-get clean
# Download and untar Android SDK
RUN curl -L "${ANDROID_SDK_URL}" | tar --no-same-owner -xz -C /usr/local
ENV ANDROID_HOME /usr/local/android-sdk-linux
ENV ANDROID_SDK /usr/local/android-sdk-linux
# Download and untar Android NDK -- This may take a few minutes
RUN curl -L "${ANDROID_NDK_URL}" | tar --no-same-owner -jx -C /usr/local
ENV ANDROID_NDK /usr/local/android-ndk-r9b
# Install fb-adb command
RUN curl -L "${FB_ADB_URL}" | tar --no-same-owner -xz -C /usr/local
RUN cd /usr/local/fb-adb-1.4.4/ && mkdir build && cd build/ && ../configure && make && \
cp ./fb-adb /usr/local/bin/ && chmod u+x /usr/local/bin/fb-adb && rm -rf /usr/local/fb-adb-1.4.4/
# Install Android SDK components
# We can find package name on the command: android list sdk --extended --all
ARG ANDROID_COMPONENTS="platform-tools,build-tools-23.0.2,android-23,android-14,sys-img-armeabi-v7a-android-14"
ARG GOOGLE_COMPONENTS="extra-android-m2repository,extra-google-m2repository,extra-google-google_play_services"
RUN echo y | android update sdk --no-ui --all --filter "${ANDROID_COMPONENTS}" ; \
echo y | android update sdk --no-ui --all --filter "${GOOGLE_COMPONENTS}"
# Create the Android emulator
RUN echo n | android create avd -n test_android_14 -f -t android-14 && \
mksdcard -l e 128M sdcard.img
# Disable the animation settings on the android emulator
# See
RUN emulator -avd test_android_14 -no-audio -no-boot-anim -no-window -sdcard sdcard.img -force-32bit & \
fb-adb wait-for-device && \
export DEVICE_DB_PATH="/data/data/" && \
fb-adb shell "ls ${DEVICE_DB_PATH}" >/dev/null 2>&1 || \
while [ $? -ne 0 ]; do sleep 5; echo -n "."; fb-adb shell "ls ${DEVICE_DB_PATH}" >/dev/null 2>&1; done && \
fb-adb shell "echo \"update system set value=0.0 where name='window_animation_scale';\" | sqlite3 ${DEVICE_DB_PATH}" && \
fb-adb shell "echo \"update system set value=0.0 where name='transition_animation_scale';\" | sqlite3 ${DEVICE_DB_PATH}" && \
sleep 5 && fb-adb emu kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.