mirror of
https://github.com/budtmo/docker-android.git
synced 2026-07-31 04:07:25 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34fa736916 | ||
|
|
b707d1971f | ||
|
|
5923820261 | ||
|
|
d9389a48c6 | ||
|
|
611a93d926 | ||
|
|
4d64ece2f9 | ||
|
|
d1126b58c2 | ||
|
|
d881cb2e06 | ||
|
|
9f0c6a595e | ||
|
|
8c09a3e169 | ||
|
|
0e1ffe9cff | ||
|
|
9adec7fcfd | ||
|
|
4de36e6568 | ||
|
|
c299582ac4 | ||
|
|
69654cd036 | ||
|
|
81f110adea | ||
|
|
068bb87ab3 | ||
|
|
d1559b6748 | ||
|
|
5c3cc8ed4d | ||
|
|
2ba73f87e0 | ||
|
|
d789139be9 | ||
|
|
b162e2ee58 | ||
|
|
42b4775e9f | ||
|
|
4213882f04 | ||
|
|
1b6bdab388 | ||
|
|
087c91922c | ||
|
|
168f51471c | ||
|
|
19e26a086b | ||
|
|
de073327af | ||
|
|
e7d684eb0a | ||
|
|
6237f452f8 | ||
|
|
cd2a7a5bcd | ||
|
|
92acd04a53 | ||
|
|
7afe1c0e54 | ||
|
|
455bf6023d | ||
|
|
ce9936b6df | ||
|
|
359551e272 | ||
|
|
c888c05572 | ||
|
|
3479738457 | ||
|
|
98a3b3d8d5 | ||
|
|
abf1d33e62 | ||
|
|
9e826e4f61 | ||
|
|
5c2045a840 | ||
|
|
aa7e88cf46 | ||
|
|
4ac0bebe99 | ||
|
|
ac9b6e9af7 | ||
|
|
65afbdeeba | ||
|
|
ed29b14c9e | ||
|
|
54cb0fc824 | ||
|
|
15375cc53b | ||
|
|
4516899786 | ||
|
|
b1be8ceeab |
Regular → Executable
+9
-3
@@ -1,10 +1,16 @@
|
||||
**Please make sure that it is an issue / a feature request. If it is a question / help wanted, please visit [our group chat](https://gitter.im/butomo1989/docker-android). Thank you!**
|
||||
---
|
||||
|
||||
name: 🐛 Bug report
|
||||
about: Report a bug to improve the tool
|
||||
---
|
||||
|
||||
## 🐛 Bug Report
|
||||
|
||||
Operating System:
|
||||
<!-- OSX Yosemite, Ubuntu 16.04, Windows 10 etc -->
|
||||
<!-- OSX Yosemite, Ubuntu 18.04, Windows 10 etc -->
|
||||
|
||||
Docker Image:
|
||||
<!-- butomo1989/docker-android-x86-7.1.1, butomo1989/docker-android-real-device etc -->
|
||||
<!-- budtmo/docker-android-x86-7.1.1, budtmo/docker-android-real-device etc -->
|
||||
|
||||
Docker Version:
|
||||
<!-- 17.09.0-ce, 17.06.2-ce etc -->
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
---
|
||||
|
||||
name: 🚀 Feature Request
|
||||
about: Submit your idea to have cool features
|
||||
---
|
||||
|
||||
## 🚀 Feature Request
|
||||
|
||||
Idea:
|
||||
<!-- A clear explanation about the feature -->
|
||||
|
||||
Problems that want to be solved:
|
||||
<!-- A clear explanation about why we need that feature -->
|
||||
|
||||
Note:
|
||||
<!-- Additional note -->
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
---
|
||||
|
||||
name: 💬 Questions / Help
|
||||
about: If you have questions, please check the group chat
|
||||
---
|
||||
|
||||
## 💬 Questions and Help
|
||||
|
||||
**Please make sure that it is an issue / a feature request. If it is a question / help wanted, please visit [our group chat](https://gitter.im/budtmo/docker-android). Thank you!**
|
||||
Regular → Executable
@@ -52,7 +52,7 @@ List of Docker images
|
||||
|Linux|8.1|27|chrome|61.0|2.33|budtmo/docker-android-x86-8.1|[](https://microbadger.com/images/budtmo/docker-android-x86-8.1 "Get your own image badge on microbadger.com")|
|
||||
|Linux|9.0|28|chrome|66.0|2.40|budtmo/docker-android-x86-9.0|[](https://microbadger.com/images/budtmo/docker-android-x86-9.0 "Get your own image badge on microbadger.com")|
|
||||
|All |-|-|-|-|-|budtmo/docker-android-real-device|[](https://microbadger.com/images/budtmo/docker-android-real-device "Get your own image badge on microbadger.com")|
|
||||
|Linux|All|All|All|All|All|budtmo/docker-android-genymotion|[](https://microbadger.com/images/budtmo/docker-android-genymotion "Get your own image badge on microbadger.com")|
|
||||
|All|All|All|All|All|All|budtmo/docker-android-genymotion|[](https://microbadger.com/images/budtmo/docker-android-genymotion "Get your own image badge on microbadger.com")|
|
||||
|
||||
List of Devices
|
||||
---------------
|
||||
@@ -239,6 +239,14 @@ All logs inside container are stored under folder **/var/log/supervisor**. you c
|
||||
docker exec -it android-container tail -f /var/log/supervisor/docker-android.stdout.log
|
||||
```
|
||||
|
||||
Emulator Skins
|
||||
--------------
|
||||
The Emulator skins are taken from [Android Studio IDE](https://developer.android.com/studio) and [Samsung Developer Website](https://developer.samsung.com/home.do)
|
||||
|
||||
Security
|
||||
--------
|
||||
All docker images are protected by [Polyverse](https://polyverse.io/) by scrambling the Linux packages. For more information please read [this](https://polyverse.io/how-it-works/)
|
||||
|
||||
Special Thanks
|
||||
--------------
|
||||
- [Gian Christanto] for creating a great logo!
|
||||
|
||||
+10
-4
@@ -1,11 +1,12 @@
|
||||
Proxy
|
||||
-----
|
||||
|
||||
You can enable proxy inside container by passing following environment variables:
|
||||
You can enable proxy inside container and Android emulator by passing following environment variables:
|
||||
|
||||
- HTTP_PROXY="\<docker\_bridge\_ip\_address>"
|
||||
- HTTPS_PROXY="\<docker\_bridge\_ip\_address>"
|
||||
- HTTP_PROXY="http://\<docker\_bridge\_ip>:<port>"
|
||||
- HTTPS_PROXY=""http://\<docker\_bridge\_ip>:<port>"
|
||||
- NO_PROXY="localhost"
|
||||
- ENABLE_PROXY_ON_EMULATOR=true
|
||||
|
||||
Language
|
||||
--------
|
||||
@@ -31,6 +32,11 @@ If you want to add more arguments for running emulator, you can ***pass an envir
|
||||
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -e EMULATOR_ARGS="-no-snapshot-load -partition-size 512" --name android-container budtmo/docker-android-x86-8.1
|
||||
```
|
||||
|
||||
Appium Test Distribution (ATD)
|
||||
------------------------------
|
||||
|
||||
You can enable [ATD](https://github.com/AppiumTestDistribution/AppiumTestDistribution) by passing environment variable ATD=true and bind the port to the host, e.g. -p 4567:4567
|
||||
|
||||
SaltStack
|
||||
---------
|
||||
|
||||
@@ -45,7 +51,7 @@ If you want to backup/reuse the avds created with furture upgrades or for replic
|
||||
- -v local_backup/android_emulator:/root/android_emulator
|
||||
|
||||
```bash
|
||||
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v local_backup/.android:/root/.android -v local_backup/android_emulator:local_backup/android_emulator -e DEVICE="Nexus 5" --name android-container budtmo/docker-android-x86-8.1
|
||||
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v local_backup/.android:/root/.android -v local_backup/android_emulator:/root/android_emulator -e DEVICE="Nexus 5" --name android-container budtmo/docker-android-x86-8.1
|
||||
```
|
||||
|
||||
For the first run, this will create a new avd and all the changes will be accessible in the `local_backup` directory. Now for all future runs, it will reuse the avds. Even this should work with new releases of `docker-android`
|
||||
|
||||
@@ -3,7 +3,7 @@ Genymotion Cloud
|
||||
|
||||

|
||||
|
||||
You can easily scale your Appium tests on Genymotion Android virtual devices in the cloud. They are available on SaaS or as virtual images on AWS, GCP or Alibaba Cloud.
|
||||
You can easily scale your Appium tests on Genymotion Android virtual devices in the cloud. They are available on [SaaS](http://bit.ly/2YP0P1l) or as virtual images on AWS, GCP or Alibaba Cloud.
|
||||
|
||||
1. On SaaS <br />
|
||||
Use [device.json](genymotion/example/sample_devices/devices.json) to define the device to start. You can specify the port on which the device will start so you don't need to change the device name in your tests every time you need to run those tests. Then run following command
|
||||
@@ -11,11 +11,12 @@ You can easily scale your Appium tests on Genymotion Android virtual devices in
|
||||
```bash
|
||||
export USER="xxx"
|
||||
export PASS="xxx"
|
||||
export LICENSE="xxx"
|
||||
|
||||
docker run -it --rm -p 4723:4723 -v $PWD/genymotion/example/sample_devices:/root/tmp -e TYPE=SaaS -e USER=$USER -e PASS=$PASS -e LICENSE=$LICENSE budtmo/docker-android-genymotion
|
||||
docker run -it --rm -p 4723:4723 -v $PWD/genymotion/example/sample_devices:/root/tmp -e TYPE=SaaS -e USER=$USER -e PASS=$PASS budtmo/docker-android-genymotion
|
||||
```
|
||||
|
||||
In case you are interesed to play around with Genymotion on SaaS, you can register to [this link](http://bit.ly/2YP0P1l) to get 1000 free minutes for free.
|
||||
|
||||
2. On PaaS (AWS) <br />
|
||||
Use [aws.json](genymotion/example/sample_devices/aws.json) to define configuration of EC2 instance and run following command:
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Sources
|
||||
--------
|
||||
|
||||
The Emulator skins are taken from [Android Studio IDE](https://developer.android.com/studio) and [Samsung Developer Website](https://developer.samsung.com/home.do)
|
||||
@@ -1,3 +0,0 @@
|
||||
Sources:
|
||||
1. Android Studio IDE
|
||||
2. http://developer.samsung.com/technical-doc/view.do?v=T000000095
|
||||
+31
-1
@@ -1,4 +1,4 @@
|
||||
FROM appium/appium:1.11.1-p1
|
||||
FROM appium/appium:1.14.0-p0
|
||||
|
||||
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
||||
|
||||
@@ -7,6 +7,18 @@ LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
||||
#=============
|
||||
WORKDIR /root
|
||||
|
||||
#===========
|
||||
# Polyverse
|
||||
# https://polyverse.io/how-it-works/
|
||||
#===========
|
||||
ARG TOKEN=xxx
|
||||
|
||||
RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \
|
||||
if [ $? -eq 0 ]; then \
|
||||
apt -y update && \
|
||||
apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \
|
||||
fi
|
||||
|
||||
#==================
|
||||
# General Packages
|
||||
#------------------
|
||||
@@ -21,8 +33,11 @@ WORKDIR /root
|
||||
#------------------
|
||||
# x11vnc
|
||||
# VNC server for X display
|
||||
# We use package from ubuntu 18.10 to fix crashing issue
|
||||
# openbox
|
||||
# Windows manager
|
||||
# feh
|
||||
# ScreenBackground
|
||||
# menu
|
||||
# Debian menu
|
||||
# python-numpy
|
||||
@@ -46,12 +61,15 @@ WORKDIR /root
|
||||
# ubuntu-vm-builder
|
||||
# bridge-utils
|
||||
#==================
|
||||
ADD docker/configs/sources1810.list /etc/apt/sources.list.d/
|
||||
ADD docker/configs/x11vnc.pref /etc/apt/preferences.d/
|
||||
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
||||
xterm \
|
||||
supervisor \
|
||||
socat \
|
||||
x11vnc \
|
||||
openbox \
|
||||
feh \
|
||||
menu \
|
||||
python-numpy \
|
||||
net-tools \
|
||||
@@ -61,6 +79,7 @@ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
||||
libvirt-bin \
|
||||
ubuntu-vm-builder \
|
||||
bridge-utils \
|
||||
&& apt clean all \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#=======
|
||||
@@ -142,6 +161,17 @@ ENV DISPLAY=:0 \
|
||||
VIDEO_PATH=/tmp/video \
|
||||
LOG_PATH=/var/log/supervisor
|
||||
|
||||
#================================================
|
||||
# openbox configuration
|
||||
# Update the openbox configuration files to:
|
||||
# + Use a single virtual desktop to prevent accidentally switching
|
||||
# + Add background
|
||||
#================================================
|
||||
ADD images/logo_dockerandroid_small.png /root/logo.png
|
||||
ADD src/.fehbg /root/.fehbg
|
||||
RUN sed -i "s/<number>4<\/number>/<number>1<\/number>/g" /etc/xdg/openbox/rc.xml \
|
||||
&& echo /root/.fehbg >> /etc/xdg/openbox/autostart
|
||||
|
||||
#===============
|
||||
# Expose Ports
|
||||
#---------------
|
||||
|
||||
+52
-12
@@ -1,4 +1,4 @@
|
||||
FROM appium/appium:1.11.1-p1
|
||||
FROM appium/appium:1.14.0-p0
|
||||
|
||||
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
||||
|
||||
@@ -7,6 +7,18 @@ LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
||||
#=============
|
||||
WORKDIR /root
|
||||
|
||||
#===========
|
||||
# Polyverse
|
||||
# https://polyverse.io/how-it-works/
|
||||
#===========
|
||||
ARG TOKEN=xxx
|
||||
|
||||
RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \
|
||||
if [ $? -eq 0 ]; then \
|
||||
apt -y update && \
|
||||
apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \
|
||||
fi
|
||||
|
||||
#==================
|
||||
# General Packages
|
||||
#------------------
|
||||
@@ -21,15 +33,24 @@ WORKDIR /root
|
||||
#------------------
|
||||
# Genymotion spec
|
||||
#------------------
|
||||
# bzip2
|
||||
# File compression
|
||||
# python3-setuptools
|
||||
# PPython packaging facilitator
|
||||
# python3-wheel
|
||||
# Python distribution
|
||||
# python3-pip
|
||||
# Python package installer
|
||||
#------------------
|
||||
# NoVNC Packages
|
||||
#------------------
|
||||
# x11vnc
|
||||
# VNC server for X display
|
||||
# We use package from ubuntu 18.10 to fix crashing issue
|
||||
# openbox
|
||||
# Windows manager
|
||||
# feh
|
||||
# ScreenBackground
|
||||
# python-xdg
|
||||
# Required by openbox autostart function
|
||||
# menu
|
||||
# Debian menu
|
||||
# python-numpy
|
||||
@@ -44,19 +65,26 @@ WORKDIR /root
|
||||
# jq
|
||||
# Sed for JSON data
|
||||
#==================
|
||||
ADD docker/configs/sources1810.list /etc/apt/sources.list.d/
|
||||
ADD docker/configs/x11vnc.pref /etc/apt/preferences.d/
|
||||
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
||||
xterm \
|
||||
supervisor \
|
||||
socat \
|
||||
keychain \
|
||||
bzip2 \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
python3-pip \
|
||||
x11vnc \
|
||||
openbox \
|
||||
feh \
|
||||
python-xdg \
|
||||
menu \
|
||||
python-numpy \
|
||||
net-tools \
|
||||
ffmpeg \
|
||||
jq \
|
||||
&& apt clean all \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#=======
|
||||
@@ -98,19 +126,31 @@ ENV DISPLAY=:0 \
|
||||
APP_RELEASE_VERSION=$APP_RELEASE_VERSION \
|
||||
APP_TYPE=Genymotion
|
||||
|
||||
#================================================
|
||||
# openbox configuration
|
||||
# Update the openbox configuration files to:
|
||||
# + Use a single virtual desktop to prevent accidentally switching
|
||||
# + Add background
|
||||
#================================================
|
||||
ADD images/logo_dockerandroid_small.png /root/logo.png
|
||||
ADD src/.fehbg /root/.fehbg
|
||||
RUN sed -i "s/<number>4<\/number>/<number>1<\/number>/g" /etc/xdg/openbox/rc.xml \
|
||||
&& echo /root/.fehbg >> /etc/xdg/openbox/autostart
|
||||
|
||||
#============
|
||||
# Set Locale
|
||||
#============
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
|
||||
#====================
|
||||
# Install genymotion
|
||||
#====================
|
||||
RUN echo | ssh-keygen -q
|
||||
ARG GENYMOTION_VERSION=3.0.1
|
||||
ENV GENYMOTION=true \
|
||||
GENYMOTION_VERSION=$GENYMOTION_VERSION \
|
||||
PATH="${PATH}:/opt/genymobile/genymotion/" \
|
||||
INSTANCES_PATH=/root/tmp/instances.txt \
|
||||
APPIUM_LOG=$LOG_PATH/appium.log
|
||||
RUN wget -nv -O genymotion.bin "https://dl.genymotion.com/releases/genymotion-${GENYMOTION_VERSION}/genymotion-${GENYMOTION_VERSION}-linux_x64.bin" \
|
||||
&& chmod +x ./genymotion.bin \
|
||||
&& yes | ./genymotion.bin \
|
||||
&& rm genymotion.bin
|
||||
RUN pip3 install gmsaas
|
||||
COPY genymotion/generate_config.sh genymotion/geny_start.sh genymotion/enable_adb.sh /root/
|
||||
|
||||
#===================
|
||||
@@ -141,5 +181,5 @@ EXPOSE 4723 6080 5555
|
||||
COPY src /root/src
|
||||
COPY supervisord.conf /root/
|
||||
RUN chmod -R +x /root/src && chmod +x /root/supervisord.conf /root/geny_start.sh
|
||||
RUN gmtool --cloud config use_custom_sdk=on sdk_path=/root
|
||||
RUN gmsaas config set android-sdk-path /root
|
||||
CMD ["./geny_start.sh"]
|
||||
|
||||
+46
-1
@@ -1,4 +1,4 @@
|
||||
FROM appium/appium:1.11.1-p1
|
||||
FROM appium/appium:1.14.0-p0
|
||||
|
||||
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
||||
|
||||
@@ -7,6 +7,18 @@ LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
||||
#=============
|
||||
WORKDIR /root
|
||||
|
||||
#===========
|
||||
# Polyverse
|
||||
# https://polyverse.io/how-it-works/
|
||||
#===========
|
||||
ARG TOKEN=xxx
|
||||
|
||||
RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \
|
||||
if [ $? -eq 0 ]; then \
|
||||
apt -y update && \
|
||||
apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \
|
||||
fi
|
||||
|
||||
#==================
|
||||
# General Packages
|
||||
#------------------
|
||||
@@ -21,8 +33,13 @@ WORKDIR /root
|
||||
#------------------
|
||||
# x11vnc
|
||||
# VNC server for X display
|
||||
# We use package from ubuntu 18.10 to fix crashing issue
|
||||
# openbox
|
||||
# Windows manager
|
||||
# feh
|
||||
# ScreenBackground
|
||||
# python-xdg
|
||||
# Required by openbox autostart function
|
||||
# menu
|
||||
# Debian menu
|
||||
# python-numpy
|
||||
@@ -37,19 +54,36 @@ WORKDIR /root
|
||||
# jq
|
||||
# Sed for JSON data
|
||||
#==================
|
||||
ADD docker/configs/sources1810.list /etc/apt/sources.list.d/
|
||||
ADD docker/configs/x11vnc.pref /etc/apt/preferences.d/
|
||||
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
||||
xterm \
|
||||
supervisor \
|
||||
socat \
|
||||
x11vnc \
|
||||
openbox \
|
||||
feh \
|
||||
python-xdg \
|
||||
menu \
|
||||
python-numpy \
|
||||
net-tools \
|
||||
ffmpeg \
|
||||
jq \
|
||||
&& apt clean all \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#===========
|
||||
# Polyverse
|
||||
# https://polyverse.io/how-it-works/
|
||||
#===========
|
||||
ARG TOKEN=xxx
|
||||
|
||||
RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \
|
||||
if [ $? -eq 0 ]; then \
|
||||
apt -y update && \
|
||||
apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \
|
||||
fi
|
||||
|
||||
#=======
|
||||
# noVNC
|
||||
# Use same commit id that docker-selenium uses
|
||||
@@ -89,6 +123,17 @@ ENV DISPLAY=:0 \
|
||||
APP_RELEASE_VERSION=$APP_RELEASE_VERSION \
|
||||
APP_TYPE=Device
|
||||
|
||||
#================================================
|
||||
# openbox configuration
|
||||
# Update the openbox configuration files to:
|
||||
# + Use a single virtual desktop to prevent accidentally switching
|
||||
# + Add background
|
||||
#================================================
|
||||
ADD images/logo_dockerandroid_small.png /root/logo.png
|
||||
ADD src/.fehbg /root/.fehbg
|
||||
RUN sed -i "s/<number>4<\/number>/<number>1<\/number>/g" /etc/xdg/openbox/rc.xml \
|
||||
&& echo /root/.fehbg >> /etc/xdg/openbox/autostart
|
||||
|
||||
#=========================
|
||||
# Set default variables
|
||||
#=========================
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
deb http://archive.ubuntu.com/ubuntu/ cosmic main restricted universe
|
||||
deb http://security.ubuntu.com/ubuntu/ cosmic-security main restricted universe
|
||||
@@ -0,0 +1,6 @@
|
||||
Package: *
|
||||
Pin: release n=bionic
|
||||
Pin-Priority: -10
|
||||
Package: x11vnc*
|
||||
Pin: release n=cosmic
|
||||
Pin-Priority: 500
|
||||
@@ -24,7 +24,6 @@ services:
|
||||
- TEMPLATE=/root/tmp/devices.json
|
||||
- USER=$USER
|
||||
- PASS=$PASS
|
||||
- LICENSE=$LICENSE
|
||||
- CONNECT_TO_GRID=true
|
||||
|
||||
# Please stop this container by using docker stop instead of docker-compose stop
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[
|
||||
{
|
||||
"template": "Samsung Galaxy S7 - 6.0.0 - API 23 - 1440x2560",
|
||||
"template": "a2a0c86c-7572-45fe-98d0-66f8efed9fa0",
|
||||
"device": "SamsungS7V6",
|
||||
"port": 38727
|
||||
},
|
||||
{
|
||||
"template": "Google Nexus 6 - 8.0 - API 26 - 1440x2560",
|
||||
"template": "80a67ae9-430c-4824-a386-befbb19518b9",
|
||||
"device": "Nexus6V8"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
(export USER=$USER && export PASS=$PASS && export LICENSE=$LICENSE && docker-compose -f geny.yml up -d)
|
||||
(export USER=$USER && export PASS=$PASS && docker-compose -f geny.yml up -d)
|
||||
|
||||
@@ -38,16 +38,26 @@ export TYPES=${types[@]}
|
||||
getAbort() {
|
||||
case $TYPE in
|
||||
"${types[0]}" )
|
||||
contents=$(cat $TEMPLATE)
|
||||
echo "ABORT SIGNAL detected! Stopping all created emulators..."
|
||||
for row in $(echo "${contents}" | jq -r '.[] | @base64'); do
|
||||
get_value() {
|
||||
echo ${row} | base64 --decode | jq -r ${1}
|
||||
}
|
||||
echo "ABORT SIGNAL detected! Stopping all created instances / emulators..."
|
||||
|
||||
gmtool --cloud admin stopdisposable $(get_value '.device')
|
||||
done
|
||||
echo "Done"
|
||||
# Get the list of created instances from the instance.txt
|
||||
if [ ! -f "$INSTANCES_PATH" ]; then
|
||||
echo "File not found! Nothing to do!"
|
||||
exit 1
|
||||
else
|
||||
content=$(cat ${INSTANCES_PATH})
|
||||
read -a instances <<< $content
|
||||
echo "All created instances: ${instances[@]}"
|
||||
|
||||
# Stop the instance one by one
|
||||
for i in "${instances[@]}"
|
||||
do
|
||||
echo "stop instance with id \"${i}\""
|
||||
gmsaas instances stop "${i}"
|
||||
echo "stopped"
|
||||
done
|
||||
echo "Done"
|
||||
fi
|
||||
;;
|
||||
"${types[1]}" )
|
||||
contents=$(cat $TEMPLATE)
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Bash version should >= 4 to be able to run this script.
|
||||
|
||||
IMAGE="budtmo/docker-android"
|
||||
IMAGE="${DOCKER_ORG:-budtmo}/docker-android"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
read -p "Task (test|build|push|all) : " TASK
|
||||
@@ -161,7 +161,7 @@ function build() {
|
||||
image_latest="$IMAGE-$processor-$v:latest"
|
||||
echo "[BUILD] Image name: $image_version and $image_latest"
|
||||
echo "[BUILD] Dockerfile: $FILE_NAME"
|
||||
docker build -t $image_version --build-arg ANDROID_VERSION=$v --build-arg API_LEVEL=$level \
|
||||
docker build -t $image_version --build-arg TOKEN=$TOKEN --build-arg ANDROID_VERSION=$v --build-arg API_LEVEL=$level \
|
||||
--build-arg PROCESSOR=$processor --build-arg SYS_IMG=$sys_img --build-arg IMG_TYPE=$IMG_TYPE \
|
||||
--build-arg BROWSER=$BROWSER --build-arg CHROME_DRIVER=$chrome_driver \
|
||||
--build-arg APP_RELEASE_VERSION=$RELEASE -f $FILE_NAME .
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ image_latest="$IMAGE-genymotion:latest"
|
||||
function build() {
|
||||
echo "[BUILD] Image name: $image_version and $image_latest"
|
||||
echo "[BUILD] Dockerfile: $FILE_NAME"
|
||||
docker build -t $image_version --build-arg APP_RELEASE_VERSION=$RELEASE -f $FILE_NAME .
|
||||
docker build -t $image_version --build-arg TOKEN=$TOKEN --build-arg APP_RELEASE_VERSION=$RELEASE -f $FILE_NAME .
|
||||
docker tag $image_version $image_latest
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ image_latest="$IMAGE-real-device:latest"
|
||||
function build() {
|
||||
echo "[BUILD] Image name: $image_version and $image_latest"
|
||||
echo "[BUILD] Dockerfile: $FILE_NAME"
|
||||
docker build -t $image_version --build-arg APP_RELEASE_VERSION=$RELEASE -f $FILE_NAME .
|
||||
docker build -t $image_version --build-arg TOKEN=$TOKEN --build-arg APP_RELEASE_VERSION=$RELEASE -f $FILE_NAME .
|
||||
docker tag $image_version $image_latest
|
||||
}
|
||||
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
feh --bg-max '/root/logo.png'
|
||||
+28
-10
@@ -50,8 +50,22 @@ def convert_str_to_bool(str: str) -> bool:
|
||||
logger.error(err)
|
||||
|
||||
|
||||
def is_initialized() -> bool:
|
||||
return os.path.exists(os.path.join(ROOT, '.android', 'devices.xml'))
|
||||
def is_initialized(device_name) -> bool:
|
||||
config_path = os.path.join(ROOT, 'android_emulator', 'config.ini')
|
||||
|
||||
if os.path.exists(config_path):
|
||||
logger.info('Found existing config file at {}.'.format(config_path))
|
||||
with open(config_path, 'r') as f:
|
||||
if any('hw.device.name={}'.format(device_name) in line for line in f):
|
||||
logger.info('Existing config file references {}. Assuming device was previously initialized.'.format(device_name))
|
||||
return True
|
||||
else:
|
||||
logger.info('Existing config file does not reference {}. Assuming new device.'.format(device_name))
|
||||
return False
|
||||
|
||||
logger.info('No config file file was found at {}. Assuming new device.'.format(config_path))
|
||||
return False
|
||||
|
||||
|
||||
ANDROID_HOME = get_or_raise('ANDROID_HOME')
|
||||
ANDROID_VERSION = get_or_raise('ANDROID_VERSION')
|
||||
@@ -68,7 +82,7 @@ logger.info('Android version: {version} \n'
|
||||
img=SYS_IMG, img_type=IMG_TYPE))
|
||||
|
||||
|
||||
def prepare_avd(device: str, avd_name: str):
|
||||
def prepare_avd(device: str, avd_name: str, dp_size: str):
|
||||
"""
|
||||
Create and run android virtual device.
|
||||
|
||||
@@ -101,6 +115,8 @@ def prepare_avd(device: str, avd_name: str):
|
||||
config_path = '/'.join([avd_path, 'config.ini'])
|
||||
with open(config_path, 'a') as file:
|
||||
file.write('skin.path={sp}'.format(sp=skin_path))
|
||||
file.write('\ndisk.dataPartition.size={dp}'.format(dp=dp_size))
|
||||
|
||||
logger.info('Skin was added in config.ini')
|
||||
|
||||
|
||||
@@ -192,21 +208,23 @@ def run():
|
||||
|
||||
avd_name = '{device}_{version}'.format(device=device.replace(' ', '_').lower(), version=ANDROID_VERSION)
|
||||
logger.info('AVD name: {avd}'.format(avd=avd_name))
|
||||
is_first_run = not is_initialized()
|
||||
is_first_run = not is_initialized(device)
|
||||
|
||||
dp_size = os.getenv('DATAPARTITION', '550m')
|
||||
|
||||
if is_first_run:
|
||||
logger.info('Preparing emulator...')
|
||||
prepare_avd(device, avd_name)
|
||||
prepare_avd(device, avd_name, dp_size)
|
||||
|
||||
logger.info('Run emulator...')
|
||||
dp_size = os.getenv('DATAPARTITION', '550m')
|
||||
with open("/root/android_emulator/config.ini", "a") as cfg:
|
||||
cfg.write('\ndisk.dataPartition.size={dp}'.format(dp=dp_size))
|
||||
|
||||
if is_first_run:
|
||||
cmd = 'emulator/emulator @{name} -gpu off -verbose -wipe-data {custom_args}'.format(name=avd_name, custom_args=custom_args)
|
||||
logger.info('Emulator was not previously initialized. Preparing a new one...')
|
||||
cmd = 'emulator/emulator @{name} -gpu swiftshader_indirect -accel on -wipe-data -writable-system -verbose {custom_args}'.format(name=avd_name, custom_args=custom_args)
|
||||
else:
|
||||
cmd = 'emulator/emulator @{name} -gpu off -verbose {custom_args}'.format(name=avd_name, custom_args=custom_args)
|
||||
logger.info('Using previously initialized AVD...')
|
||||
cmd = 'emulator/emulator @{name} -gpu swiftshader_indirect -accel on -verbose -writable-system {custom_args}'.format(name=avd_name, custom_args=custom_args)
|
||||
|
||||
appium = convert_str_to_bool(str(os.getenv('APPIUM', False)))
|
||||
if appium:
|
||||
subprocess.Popen(cmd.split())
|
||||
|
||||
+17
-9
@@ -7,12 +7,12 @@ echo "Selected type of deployment: $TYPE, Template file: $TEMPLATE"
|
||||
function prepare_geny_cloud() {
|
||||
contents=$(cat $TEMPLATE)
|
||||
|
||||
# Register
|
||||
echo "Register user"
|
||||
gmtool config username="${USER}" password="${PASS}"
|
||||
gmtool license register "${LICENSE}"
|
||||
# LogIn
|
||||
echo "Log In"
|
||||
gmsaas auth login "${USER}" "${PASS}"
|
||||
|
||||
# Start device(s)
|
||||
created_instances=()
|
||||
echo "Creating device(s) based on given json file..."
|
||||
for row in $(echo "${contents}" | jq -r '.[] | @base64'); do
|
||||
get_value() {
|
||||
@@ -22,16 +22,24 @@ function prepare_geny_cloud() {
|
||||
template=$(get_value '.template')
|
||||
device=$(get_value '.device')
|
||||
port=$(get_value '.port')
|
||||
|
||||
|
||||
echo "Starting \"$device\" with template name \"$template\"..."
|
||||
instance_uuid=$(gmsaas instances start "${template}" "${device}")
|
||||
echo "Instance-ID: \"$instance_uuid\""
|
||||
created_instances+=("${instance_uuid}")
|
||||
|
||||
if [[ $port != null ]]; then
|
||||
echo "Starting \"$device\" with template name \"$template\" on port \"$port\"..."
|
||||
gmtool --cloud admin startdisposable "${template}" "${device}" --adb-serial-port "${port}"
|
||||
echo "Connect device on port \"$port\"..."
|
||||
gmsaas instances adbconnect "${instance_uuid}" --adb-serial-port "${port}"
|
||||
else
|
||||
echo "Starting \"$device\" with template name \"$template\"..."
|
||||
gmtool --cloud admin startdisposable "${template}" "${device}"
|
||||
echo "Connect device on port..."
|
||||
gmsaas instances adbconnect "${instance_uuid}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Store created instances in a file
|
||||
echo "All created instances: ${created_instances[@]}"
|
||||
echo "${created_instances[@]}" > "${INSTANCES_PATH}"
|
||||
}
|
||||
|
||||
function prepare_geny_aws() {
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
if [ -z "$REAL_DEVICE"]; then
|
||||
echo "Container is using android emulator"
|
||||
else
|
||||
echo "Starting android screen mirro..."
|
||||
echo "Starting android screen mirror..."
|
||||
java -jar /root/asm.jar $ANDROID_HOME
|
||||
fi
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$ATD" = true ]; then
|
||||
echo "Starting ATD..."
|
||||
java -jar /root/RemoteAppiumManager.jar -DPort=4567
|
||||
fi
|
||||
@@ -7,6 +7,13 @@ import mock
|
||||
from src import app
|
||||
|
||||
|
||||
# https://bugs.python.org/issue21258
|
||||
def mock_open(*args, **kargs):
|
||||
f_open = mock.mock_open(*args, **kargs)
|
||||
f_open.return_value.__iter__ = lambda self : iter(self.readline, '')
|
||||
return f_open
|
||||
|
||||
|
||||
class TestApp(TestCase):
|
||||
"""Unit test class to test other methods in the app."""
|
||||
|
||||
@@ -60,7 +67,6 @@ class TestApp(TestCase):
|
||||
os.environ['APPIUM'] = str(True)
|
||||
app.run()
|
||||
self.assertTrue(mocked_avd.called)
|
||||
self.assertTrue(mocked_open.called)
|
||||
self.assertTrue(mocked_subprocess.called)
|
||||
self.assertTrue(mocked_appium.called)
|
||||
|
||||
@@ -73,7 +79,6 @@ class TestApp(TestCase):
|
||||
os.environ['RELAXED_SECURITY'] = str(True)
|
||||
app.run()
|
||||
self.assertTrue(mocked_avd.called)
|
||||
self.assertTrue(mocked_open.called)
|
||||
self.assertTrue(mocked_subprocess.called)
|
||||
self.assertTrue(mocked_appium.called)
|
||||
|
||||
@@ -85,24 +90,32 @@ class TestApp(TestCase):
|
||||
os.environ['APPIUM'] = str(False)
|
||||
app.run()
|
||||
self.assertTrue(mocked_avd.called)
|
||||
self.assertTrue(mocked_open.called)
|
||||
self.assertTrue(mocked_subprocess.called)
|
||||
self.assertFalse(mocked_appium.called)
|
||||
|
||||
@mock.patch('builtins.open')
|
||||
@mock.patch('subprocess.Popen')
|
||||
@mock.patch('os.path.exists', mock.MagicMock(return_value=False))
|
||||
def test_run_first_run(self, mocked_open, mocked_subprocess):
|
||||
def test_it_prepares_avd_on_first_run(self, mocked_open, mocked_subprocess):
|
||||
with mock.patch('src.app.prepare_avd') as mocked_prepare_avd:
|
||||
app.run()
|
||||
self.assertFalse(app.is_initialized())
|
||||
self.assertFalse(app.is_initialized('Nexus 5'))
|
||||
self.assertTrue(mocked_prepare_avd.called)
|
||||
|
||||
@mock.patch('builtins.open')
|
||||
@mock.patch('subprocess.Popen')
|
||||
@mock.patch('os.path.exists', mock.MagicMock(return_value=True))
|
||||
def test_run_next_run(self, mocked_open, mocked_subprocess):
|
||||
@mock.patch('builtins.open', mock_open(read_data="\nhw.device.name=Nexus 5\n"))
|
||||
def test_it_doesnt_prepare_avd_if_config_exists(self, mocked_subprocess):
|
||||
with mock.patch('src.app.prepare_avd') as mocked_prepare_avd:
|
||||
app.run()
|
||||
self.assertTrue(app.is_initialized())
|
||||
self.assertTrue(app.is_initialized('Nexus 5'))
|
||||
self.assertFalse(mocked_prepare_avd.called)
|
||||
|
||||
@mock.patch('subprocess.Popen')
|
||||
@mock.patch('os.path.exists', mock.MagicMock(return_value=True))
|
||||
@mock.patch('builtins.open', mock_open(read_data="\nhw.device.name=Samsung S7\n"))
|
||||
def test_it_prepares_avd_if_config_is_for_another_device(self, mocked_subprocess):
|
||||
with mock.patch('src.app.prepare_avd') as mocked_prepare_avd:
|
||||
app.run()
|
||||
self.assertFalse(app.is_initialized('Nexus 5'))
|
||||
self.assertTrue(mocked_prepare_avd.called)
|
||||
|
||||
@@ -18,7 +18,7 @@ class TestAvd(TestCase):
|
||||
def test_nexus_avd_as_default(self, mocked_suprocess, mocked_open):
|
||||
self.assertFalse(mocked_suprocess.called)
|
||||
self.assertFalse(mocked_open.called)
|
||||
app.prepare_avd('Nexus 5', self.avd_name)
|
||||
app.prepare_avd('Nexus 5', self.avd_name, '550m')
|
||||
self.assertTrue(mocked_suprocess.called)
|
||||
self.assertTrue(mocked_open.called)
|
||||
|
||||
@@ -28,7 +28,7 @@ class TestAvd(TestCase):
|
||||
self.assertFalse(mocked_sys_link.called)
|
||||
self.assertFalse(mocked_suprocess.called)
|
||||
self.assertFalse(mocked_open.called)
|
||||
app.prepare_avd('Samsung Galaxy S6', self.avd_name)
|
||||
app.prepare_avd('Samsung Galaxy S6', self.avd_name, '550m')
|
||||
self.assertTrue(mocked_sys_link.called)
|
||||
self.assertTrue(mocked_suprocess.called)
|
||||
self.assertTrue(mocked_open.called)
|
||||
|
||||
+34
-1
@@ -17,7 +17,7 @@ function wait_emulator_to_be_ready () {
|
||||
function change_language_if_needed() {
|
||||
if [ ! -z "${LANGUAGE// }" ] && [ ! -z "${COUNTRY// }" ]; then
|
||||
wait_emulator_to_be_ready
|
||||
echo "Languge will be changed to ${LANGUAGE}-${COUNTRY}"
|
||||
echo "Language will be changed to ${LANGUAGE}-${COUNTRY}"
|
||||
adb root && adb shell "setprop persist.sys.language $LANGUAGE; setprop persist.sys.country $COUNTRY; stop; start" && adb unroot
|
||||
echo "Language is changed!"
|
||||
fi
|
||||
@@ -38,6 +38,39 @@ function disable_animation () {
|
||||
adb shell "settings put global animator_duration_scale 0.0"
|
||||
}
|
||||
|
||||
function enable_proxy_if_needed () {
|
||||
if [ "$ENABLE_PROXY_ON_EMULATOR" = true ]; then
|
||||
if [ ! -z "${HTTP_PROXY// }" ]; then
|
||||
if [[ $HTTP_PROXY == *"http"* ]]; then
|
||||
protocol="$(echo $HTTP_PROXY | grep :// | sed -e's,^\(.*://\).*,\1,g')"
|
||||
proxy="$(echo ${HTTP_PROXY/$protocol/})"
|
||||
echo "[EMULATOR] - Proxy: $proxy"
|
||||
|
||||
IFS=':' read -r -a p <<< "$proxy"
|
||||
|
||||
echo "[EMULATOR] - Proxy-IP: ${p[0]}"
|
||||
echo "[EMULATOR] - Proxy-Port: ${p[1]}"
|
||||
|
||||
wait_emulator_to_be_ready
|
||||
echo "Enable proxy on Android emulator. Please make sure that docker-container has internet access!"
|
||||
adb root
|
||||
|
||||
echo "Set up the Proxy"
|
||||
adb shell "content update --uri content://telephony/carriers --bind proxy:s:"${p[0]}" --bind port:s:"${p[1]}" --where "mcc=310" --where "mnc=260""
|
||||
|
||||
adb unroot
|
||||
else
|
||||
echo "Please use http:// in the beginning!"
|
||||
fi
|
||||
else
|
||||
echo "$HTTP_PROXY is not given! Please pass it through environment variable!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
enable_proxy_if_needed
|
||||
sleep 1
|
||||
change_language_if_needed
|
||||
sleep 1
|
||||
install_google_play
|
||||
|
||||
@@ -21,6 +21,7 @@ command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -nopw -forever -shared
|
||||
stdout_logfile=%(ENV_LOG_PATH)s/x11vnc.stdout.log
|
||||
stderr_logfile=%(ENV_LOG_PATH)s/x11vnc.stderr.log
|
||||
priority=2
|
||||
autorestart=true
|
||||
|
||||
[program:novnc]
|
||||
command=./noVNC/utils/launch.sh --vnc localhost:%(ENV_LOCAL_PORT)s --listen %(ENV_TARGET_PORT)s
|
||||
@@ -42,6 +43,13 @@ stdout_logfile=%(ENV_LOG_PATH)s/android-screen-mirror.stdout.log
|
||||
stderr_logfile=%(ENV_LOG_PATH)s/android-screen-mirror.stderr.log
|
||||
priority=3
|
||||
|
||||
[program:atd]
|
||||
command=./src/atd.sh
|
||||
autorestart=false
|
||||
stdout_logfile=%(ENV_LOG_PATH)s/atd.stdout.log
|
||||
stderr_logfile=%(ENV_LOG_PATH)s/atd.stderr.log
|
||||
priority=4
|
||||
|
||||
[program:docker-appium]
|
||||
command=./src/appium.sh
|
||||
autorestart=false
|
||||
|
||||
Reference in New Issue
Block a user