Compare commits

..
27 Commits
Author SHA1 Message Date
budtmo d58eb73294 Using newest base image with Appium 1.22.3 2022-05-02 10:05:39 +02:00
budtmo 2756b7febc Updated base image that contains Appium 1.22.2 2022-04-25 16:03:44 +02:00
budtmo ee5630f893 Updated base image that contains Appium 1.22.1 2022-04-25 15:49:55 +02:00
budtmo a72a5d1edc Using python 3.8.12 on pipeline 2022-04-08 12:45:34 +02:00
budtmo 9f58ad6bda Dropped polyverse support 2022-04-08 12:35:43 +02:00
Budi UtomoandGitHub 94a3f40ac6 Merge pull request #314 from inez/patch-1
(documentation) Added information about SSHing to the virtual machine
2022-02-16 10:42:41 +01:00
Inez KorczyńskiandGitHub e340223c8c Add information about SSHing to the virtual machine 2021-12-22 16:38:23 -08:00
Budi UtomoandGitHub 77488aea7f Merge pull request #310 from JoelWhitney/joel/android-11-x86_64
Android 11 build issue with 32-bit image
2021-11-17 13:59:23 +01:00
Budi UtomoandGitHub 8f1c4bf1ca Merge branch 'master' into joel/android-11-x86_64 2021-11-17 11:45:03 +01:00
Budi UtomoandGitHub cd63313358 Changed polymorphing llink 2021-11-10 15:03:48 +01:00
Joel Whitney d0f9534e3d Android 11 build issue with 32-bit image 2021-11-04 13:02:32 -04:00
budtmo 7b6bc3fe3e Removed support for Android 5.0.1 and 5.1.1 2021-10-05 10:06:46 +02:00
budtmo 1f1d4ccf49 Using the latest appium version 2021-10-05 10:03:43 +02:00
Budi UtomoandGitHub 8278a3f6ef Merge pull request #303 from syntx/patch-1
Update README_CUSTOM_CONFIG.md
2021-10-05 10:01:38 +02:00
syntxandGitHub 92ea480e55 Update README_CUSTOM_CONFIG.md
This seems like a typo in the documentation, according to: https://github.com/budtmo/docker-android/blob/0a8b7c07a2659fe9bd316bac8c21c506f953620a/src/utils.sh#L60-L62
2021-10-04 23:55:29 +03:00
budtmo 0188131350 Replaced operator 2021-08-05 13:28:43 +02:00
budtmo 371a57c663 Added Android 12.0 into pipeline 2021-08-05 12:28:04 +02:00
Budi UtomoandGitHub 6d4de35602 Merge pull request #297 from JoelWhitney/android_12
Support Android 12 (API 31)
2021-08-05 12:24:47 +02:00
Joel Whitney 51158d8630 processor 2021-08-03 18:04:53 -04:00
Joel Whitney 3a7cba3dc9 x86_64 2021-08-03 17:16:21 -04:00
Joel Whitney 4bb9f044ed 12 2021-08-03 16:15:59 -04:00
budtmo 0e35dab27f Updated base image 2021-07-20 17:21:42 +02:00
Budi UtomoandGitHub 14a98aea88 Merge pull request #294 from ireneu/master
Check correctly if device exists
2021-07-20 17:17:57 +02:00
IreandGitHub 337aaf5103 Use regex to verify config 2021-07-09 14:20:52 +02:00
IreandGitHub f5e86d5806 Check correctly if device exists
config.ini has spaces around the equals sign
2021-07-09 10:56:29 +02:00
budtmo caf2cb2cd8 Fixed pip issue on Azure DevOps 2021-06-21 12:15:51 +02:00
budtmo 03f2ea256a Fixed wrong name 2021-06-21 12:10:18 +02:00
11 changed files with 54 additions and 82 deletions
+9 -13
View File
@@ -44,8 +44,6 @@ List of Docker images
|OS |Android |API |Browser |Browser version |Chromedriver |Image |Size |
|:---|:---|:---|:---|:---|:---|:---|:---|
|Linux|5.0.1|21|browser|37.0|2.21|budtmo/docker-android-x86-5.0.1|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-5.0.1.svg)](https://microbadger.com/images/budtmo/docker-android-x86-5.0.1 "Get your own image badge on microbadger.com")|
|Linux|5.1.1|22|browser|39.0|2.13|budtmo/docker-android-x86-5.1.1|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-5.1.1.svg)](https://microbadger.com/images/budtmo/docker-android-x86-5.1.1 "Get your own image badge on microbadger.com")|
|Linux|6.0|23|browser|44.0|2.18|budtmo/docker-android-x86-6.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-6.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-6.0 "Get your own image badge on microbadger.com")|
|Linux|7.0|24|chrome|51.0|2.23|budtmo/docker-android-x86-7.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-7.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-7.0 "Get your own image badge on microbadger.com")|
|Linux|7.1.1|25|chrome|55.0|2.28|budtmo/docker-android-x86-7.1.1|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-7.1.1.svg)](https://microbadger.com/images/budtmo/docker-android-x86-7.1.1 "Get your own image badge on microbadger.com")|
@@ -54,6 +52,7 @@ List of Docker images
|Linux|9.0|28|chrome|66.0|2.40|budtmo/docker-android-x86-9.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-9.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-9.0 "Get your own image badge on microbadger.com")|
|Linux|10.0|29|chrome|74.0|74.0.3729.6|budtmo/docker-android-x86-10.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-10.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-10.0 "Get your own image badge on microbadger.com")|
|Linux|11.0|30|chrome|83.0|83.0.4103.39|budtmo/docker-android-x86-11.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-11.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-11.0 "Get your own image badge on microbadger.com")|
|Linux|12.0|31|chrome|93.0|93.0.4577.15|budtmo/docker-android-x86-12.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-12.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-12.0 "Get your own image badge on microbadger.com")|
|All |-|-|-|-|-|budtmo/docker-android-real-device|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-real-device.svg)](https://microbadger.com/images/budtmo/docker-android-real-device "Get your own image badge on microbadger.com")|
|All|All|All|All|All|All|budtmo/docker-android-genymotion|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-genymotion.svg)](https://microbadger.com/images/budtmo/docker-android-genymotion "Get your own image badge on microbadger.com")|
@@ -115,7 +114,7 @@ Quick Start
Custom configurations
---------------------
[This document](README_CUSTOM_CONFIG.md) contains custom configurations of Docker-Android that you might need, e.g. Proxy, Changing language on fly, etc.
[This document](README_CUSTOM_CONFIG.md) contains custom configurations of Docker-Android that you might need, e.g. Proxy, Changing language on fly, etc.
Build Android project
---------------------
@@ -133,31 +132,31 @@ Docker-Android can be used for building Android project and executing its unit t
```bash
docker run -it --rm -v $PWD/testing-samples/ui/espresso/BasicSample:/tmp -w /tmp budtmo/docker-android-x86-8.1 /tmp/gradlew build
```
Control Android connected to host (Emulator or Real Device)
-----------------------------------------------------------
1. Create a docker container with this command
1. Create a docker container with this command
```
$ docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -p 4723:4723 --name android-container-appium budtmo/docker-android-real-device
```
2. Open noVNC [http://localhost:6080](http://localhost:6080)
3. Open terminal by clicking right on **noVNC** window >> **Terminal emulator**
4. To connect to host's adb (make sure your host have adb and connected to the device.)
4. To connect to host's adb (make sure your host have adb and connected to the device.)
```
$ adb -H host.docker.internal devices
```
To specify port, just add `-P port_number`
```
$ adb -H host.docker.internal -P 5037 devices
```
5. Now your container can access your host devices. But, you need to add `remoteAdbHost` and `adbPort` desired capabilities to make **Appium** can recognise those devices.
@@ -253,11 +252,8 @@ docker exec -it android-container tail -f /var/log/supervisor/docker-android.std
Emulator Skins
--------------
The Emulator skins are taken from [Android Studio IDE](https://developer.android.com/studio) and [Samsung Developer Website](e)
The Emulator skins are taken from [Android Studio IDE](https://developer.android.com/studio) and [Samsung Developer Website](https://developer.samsung.com/)
Security
--------
All docker images are protected by [Polyverse](https://polyverse.io/) by scrambling the Linux packages. For more information please visit [this link](https://youtu.be/eSZNP42n-pM)
Monitoring
----------
+1 -1
View File
@@ -19,7 +19,7 @@ Proxy with authentication
You can set proxy with authentication by passing following environment variable:
- HTTP_PROXY_USER="\<username>"
- HTTPS_PROXY_PASSWORD="\<password>"
- HTTP_PROXY_PASSWORD="\<password>"
Language
+10 -5
View File
@@ -39,7 +39,12 @@ The following instructions are used for OS X. You'll need [docker-machine-parall
4. Enable kvm inside virtual machine
4.0 Check kvm version
4.0 SSH to the machine
```bash
docker-machine ssh vmware-dev
```
4.1 Check kvm version
```bash
# version
$ 10.1
@@ -47,23 +52,23 @@ The following instructions are used for OS X. You'll need [docker-machine-parall
Go to http://tinycorelinux.net/10.x/x86_64/tcz/ and check your kvm version, for version 10.1 is kvm-4.19.10-tinycore64.tcz
4.1. Run as an account other than root to install kvm packages using tce-load.
4.2. Run as an account other than root to install kvm packages using tce-load.
```bash
# su docker
$ tce-load -wi kvm-4.19.10-tinycore64.tcz
```
4.2. Run as root to load kvm module after kvm packages install.
4.3. Run as root to load kvm module after kvm packages install.
```bash
$ sudo modprobe kvm_intel
```
4.3. Check if the kvm device is loaded.
4.4. Check if the kvm device is loaded.
```bash
$ ls /dev/kvm
```
4.4. Check if your CPU supports hardware virtualization now
4.5. Check if your CPU supports hardware virtualization now
```bash
$ egrep -c '(vmx|svm)' /proc/cpuinfo
```
+1 -13
View File
@@ -1,4 +1,4 @@
FROM appium/appium:v1.21.0-p0
FROM appium/appium:v1.22.3-p0
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
@@ -7,18 +7,6 @@ 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
#------------------
+1 -13
View File
@@ -1,4 +1,4 @@
FROM appium/appium:v1.21.0-p0
FROM appium/appium:v1.22.3-p0
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
@@ -7,18 +7,6 @@ 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
#------------------
+1 -13
View File
@@ -1,4 +1,4 @@
FROM appium/appium:v1.21.0-p0
FROM appium/appium:v1.22.3-p0
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
@@ -7,18 +7,6 @@ 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
#------------------
+8 -5
View File
@@ -10,10 +10,6 @@ jobs:
strategy:
maxParallel: 10
matrix:
5.0.1:
android.version: '5.0.1'
5.1.1:
android.version: '5.1.1'
6.0:
android.version: '6.0'
7.0:
@@ -30,7 +26,14 @@ jobs:
android.version: '10.0'
11.0:
android.version: '11.0'
12.0:
android.version: '12.0'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8.12'
displayName: 'Use Python 3.8.12'
- script: |
latest_tag=$(git describe --tags --abbrev=0)
echo "##vso[task.setvariable variable=release_version]$latest_tag"
@@ -39,7 +42,7 @@ jobs:
- script: |
docker login -u $(DOCKER_USERNAME) -p=$(DOCKER_PASSWORD)
TOKEN=$(polyverse_token) ./release.sh all $(android.version) $(release_version)
./release.sh all $(android.version) $(release_version)
docker logout
displayName: 'Build docker image, run unit tests and push the docker image'
+7 -2
View File
@@ -13,8 +13,13 @@ jobs:
genymotion:
script.name: './release_real.sh'
real_device:
script.name: './release_genymotion.sh'
script.name: './release_geny.sh'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8.12'
displayName: 'Use Python 3.8.12'
- script: |
latest_tag=$(git describe --tags --abbrev=0)
echo "##vso[task.setvariable variable=release_version]$latest_tag"
@@ -23,7 +28,7 @@ jobs:
- script: |
docker login -u $(DOCKER_USERNAME) -p=$(DOCKER_PASSWORD)
TOKEN=$(p_token) $(script.name) all $(release_version)
$(script.name) all $(release_version)
docker logout
displayName: 'Build docker image, run unit tests and push the docker image'
+2 -2
View File
@@ -19,8 +19,8 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.5'
displayName: 'Use Python 3.5'
versionSpec: '3.8.12'
displayName: 'Use Python 3.8.12'
- script: pip install -r requirements.txt
displayName: 'Install pip packages'
- script: ./release.sh test 7.1.1 $(app_version)
+12 -14
View File
@@ -10,7 +10,7 @@ else
fi
if [ -z "$2" ]; then
read -p "Android version (5.0.1|5.1.1|6.0|7.0|7.1.1|8.0|8.1|9.0|10.0|11.0|all): " ANDROID_VERSION
read -p "Android version (6.0|7.0|7.1.1|8.0|8.1|9.0|10.0|11.0|12.0|all): " ANDROID_VERSION
else
ANDROID_VERSION=$2
fi
@@ -22,8 +22,6 @@ else
fi
declare -A list_of_levels=(
[5.0.1]=21
[5.1.1]=22
[6.0]=23
[7.0]=24
[7.1.1]=25
@@ -32,13 +30,12 @@ declare -A list_of_levels=(
[9.0]=28
[10.0]=29
[11.0]=30
[12.0]=31
)
# The version of the Chrome browser installed on the Android emulator needs to be known beforehand
# in order to chose the proper version of chromedriver (see http://chromedriver.chromium.org/downloads)
declare -A chromedriver_versions=(
[5.0.1]="2.21"
[5.1.1]="2.13"
[6.0]="2.18"
[7.0]="2.23"
[7.1.1]="2.28"
@@ -47,6 +44,7 @@ declare -A chromedriver_versions=(
[9.0]="2.40"
[10.0]="74.0.3729.6"
[11.0]="83.0.4103.39"
[12.0]="93.0.4577.15"
)
function get_android_versions() {
@@ -66,7 +64,7 @@ function get_android_versions() {
# If version cannot be found in the list
if [ -z "$versions" ]; then
echo "Android version \"$ANDROID_VERSION\" is not found in the list or not supported! Support only version 5.0.1, 5.1.1, 6.0, 7.0, 7.1.1, 8.0, 8.1"
echo "Android version \"$ANDROID_VERSION\" is not found in the list or not supported! Support only version 6.0, 7.0, 7.1.1, 8.0, 8.1, 9.0, 10.0, 11.0, 12.0"
exit 1
fi
@@ -141,27 +139,27 @@ function build() {
FILE_NAME=docker/Emulator_x86
for v in "${versions[@]}"; do
level=${list_of_levels[$v]}
# Find image type and default web browser
if [ "$v" == "5.0.1" ] || [ "$v" == "5.1.1" ]; then
IMG_TYPE=default
BROWSER=browser
elif [ "$v" == "6.0" ]; then
if [ "$v" == "6.0" ]; then
# It is because there is no ARM EABI v7a System Image for 6.0
IMG_TYPE=google_apis
BROWSER=browser
elif [ "$v" == "" ]; then
IMG_TYPE=google_apis
BROWSER=chrome
BROWSER=chrome
else
#adb root cannot be run in IMG_TYPE=google_apis_playstore
#adb root cannot be run in IMG_TYPE=google_apis_playstore
IMG_TYPE=google_apis
BROWSER=chrome
if [ "$v" == "9.0" ]; then
# Android 9 & Android 11 had build issues that requires 64-bit
# Android 12+ Google dropped 32-bit support
if [ "$v" == "9.0" ] || [ $level -ge 30 ]; then
processor=x86_64
fi
fi
echo "[BUILD] IMAGE TYPE: $IMG_TYPE"
level=${list_of_levels[$v]}
echo "[BUILD] API Level: $level"
sys_img=$processor
echo "[BUILD] System Image: $sys_img"
+2 -1
View File
@@ -3,6 +3,7 @@
import json
import logging
import os
import re
import subprocess
import uuid
@@ -56,7 +57,7 @@ def is_initialized(device_name) -> bool:
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):
if any(re.match(r'hw\.device\.name ?= ?{}'.format(device_name), line) for line in f):
logger.info('Existing config file references {}. Assuming device was previously initialized.'.format(device_name))
return True
else: