mirror of
https://github.com/budtmo/docker-android.git
synced 2026-07-31 04:07:25 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19e26a086b | ||
|
|
de073327af | ||
|
|
e7d684eb0a | ||
|
|
6237f452f8 | ||
|
|
cd2a7a5bcd | ||
|
|
92acd04a53 | ||
|
|
7afe1c0e54 | ||
|
|
455bf6023d | ||
|
|
ce9936b6df | ||
|
|
359551e272 | ||
|
|
c888c05572 | ||
|
|
3479738457 | ||
|
|
98a3b3d8d5 | ||
|
|
abf1d33e62 | ||
|
|
9e826e4f61 | ||
|
|
5c2045a840 | ||
|
|
aa7e88cf46 |
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/budtmo/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
|
||||
---------------
|
||||
|
||||
@@ -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
|
||||
--------
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
+16
-12
@@ -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,6 +33,7 @@ WORKDIR /root
|
||||
#------------------
|
||||
# x11vnc
|
||||
# VNC server for X display
|
||||
# We use package from ubuntu 18.10 to fix crashing issue
|
||||
# openbox
|
||||
# Windows manager
|
||||
# menu
|
||||
@@ -46,6 +59,8 @@ WORKDIR /root
|
||||
# ubuntu-vm-builder
|
||||
# bridge-utils
|
||||
#==================
|
||||
ADD docker/sources1810.list /etc/apt/sources.list.d/
|
||||
ADD docker/x11vnc.pref /etc/apt/preferences.d/
|
||||
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
||||
xterm \
|
||||
supervisor \
|
||||
@@ -61,20 +76,9 @@ 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/*
|
||||
|
||||
#===========
|
||||
# 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
|
||||
|
||||
+18
-11
@@ -21,8 +21,12 @@ WORKDIR /root
|
||||
#------------------
|
||||
# Genymotion spec
|
||||
#------------------
|
||||
# bzip2
|
||||
# File compression
|
||||
# python3-setuptools
|
||||
# PPython packaging facilitator
|
||||
# python3-wheel
|
||||
# Python distribution
|
||||
# python3-pip
|
||||
# Python package installer
|
||||
#------------------
|
||||
# NoVNC Packages
|
||||
#------------------
|
||||
@@ -49,7 +53,9 @@ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
||||
supervisor \
|
||||
socat \
|
||||
keychain \
|
||||
bzip2 \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
python3-pip \
|
||||
x11vnc \
|
||||
openbox \
|
||||
menu \
|
||||
@@ -110,19 +116,20 @@ ENV DISPLAY=:0 \
|
||||
APP_RELEASE_VERSION=$APP_RELEASE_VERSION \
|
||||
APP_TYPE=Genymotion
|
||||
|
||||
#============
|
||||
# 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/
|
||||
|
||||
#===================
|
||||
@@ -153,5 +160,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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -204,9 +204,9 @@ def run():
|
||||
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)
|
||||
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)
|
||||
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() {
|
||||
|
||||
@@ -38,6 +38,45 @@ 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 "Mount system to read write access"
|
||||
adb shell "mount -o rw,remount /system"
|
||||
|
||||
echo "Updateing 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""
|
||||
|
||||
echo "remount system back to read only"
|
||||
adb shell "mount -o ro,remount /system"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user