Skip to content

Commit

Permalink
fga-eps-mds#175 - Running app in android emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronyell committed May 18, 2018
1 parent fd90dc3 commit d8af0fe
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 72 deletions.
37 changes: 0 additions & 37 deletions DockerAndroid/Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions DockerAndroid/docker-compose.yml

This file was deleted.

42 changes: 39 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Pull base image.
FROM ubuntu:14.04
FROM java:8

#In Host-Terminal exec this command: sudo xhost +local:docker

# Intall unzip
RUN apt-get install unzip

# Install SDK
RUN mkdir /app/
WORKDIR /app/
RUN wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -P /app/
RUN unzip /app/sdk-tools-linux-3859397.zip -d android-sdk-linux

# ENV JAVA_HOME="/opt/jdk1.8.0_171"
ENV PATH="$PATH:${JAVA_HOME}/bin"
ENV ANDROID_HOME=/app/android-sdk-linux
ENV ANDROID_SDK_ROOT=/app/android-sdk-linux
ENV PATH=$PATH:$ANDROID_HOME/tools
ENV PATH=$PATH:$ANDROID_HOME/platform-tools
ENV PATH=$PATH:$ANDROID_HOME/tools/bin

RUN yes | sdkmanager --licenses

RUN yes | $ANDROID_HOME/tools/bin/sdkmanager "tools"

RUN echo "y" | android update sdk


RUN $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-25"
RUN $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-25;google_apis;x86"

# Create AVD
RUN $ANDROID_HOME/tools/bin/avdmanager create avd\
-n android-emulator\
-k "system-images;android-25;google_apis;x86"\
--device "Nexus 5"\
--sdcard 100M


# Install base software packages
RUN apt-get update && \
Expand Down Expand Up @@ -27,4 +63,4 @@ ENV PATH ${PATH}:/opt/node/bin
# ——————————
# Install Basic React-Native packages
# ——————————
RUN npm install -g create-react-native-app
RUN npm install -g create-react-native-app
34 changes: 15 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# version: '3'

merenda_mais:
build: .
net: host
working_dir: /app
privileged: true
volumes:
- "./:/app"
command: |
bash -c "
npm install
adb kill-server
adb reverse tcp:8081 tcp:8081
echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
npm start
"
android-emulator-merenda:
build: .
volumes:
- .:/code
privileged: true
net: host
environment:
- DISPLAY=$DISPLAY
command: |
bash -c "
cd /code/ && npm install
/app/android-sdk-linux/tools/android list avd
/app/android-sdk-linux/tools/emulator -avd android-emulator & .
sleep 2m && npm run android
"

0 comments on commit d8af0fe

Please sign in to comment.