Skip to content

Commit

Permalink
Removed ATD and cleaned up the code because of ANDROID_HOME
Browse files Browse the repository at this point in the history
  • Loading branch information
budtmo committed Aug 19, 2022
1 parent 3ea820c commit d436eb3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 25 deletions.
5 changes: 0 additions & 5 deletions README_CUSTOM_CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ 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
---------

Expand Down
4 changes: 2 additions & 2 deletions docker/Emulator_x86
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ EXPOSE 4723 6080 5554 5555
#======================
# Add Emulator Devices
#======================
COPY devices /root/devices
COPY devices ${ANDROID_HOME}/devices

#===================
# Run docker-appium
Expand All @@ -195,6 +195,6 @@ RUN chmod -R +x /root/src && chmod +x /root/supervisord.conf
HEALTHCHECK --interval=2s --timeout=40s --retries=1 \
CMD timeout 40 adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'

RUN ln -s /root/emulator/emulator /usr/bin/
RUN ln -s ${ANDROID_HOME}/emulator/emulator /usr/bin/

CMD /usr/bin/supervisord --configuration supervisord.conf
2 changes: 1 addition & 1 deletion docker/Genymotion
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,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 gmsaas config set android-sdk-path /root
RUN gmsaas config set android-sdk-path ${ANDROID_HOME}
CMD ["./geny_start.sh"]
8 changes: 4 additions & 4 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ def prepare_avd(device: str, avd_name: str, dp_size: str):
profile_dst_path = os.path.join(ROOT, '.android', 'devices.xml')
if 'samsung' in device.lower():
# profile file name = skin name
profile_src_path = os.path.join(ROOT, 'devices', 'profiles', '{profile}.xml'.format(profile=skin_name))
profile_src_path = os.path.join(ANDROID_HOME, 'devices', 'profiles', '{profile}.xml'.format(profile=skin_name))
logger.info('Hardware profile resource path: {rsc}'.format(rsc=profile_src_path))
logger.info('Hardware profile destination path: {dst}'.format(dst=profile_dst_path))
symlink_force(profile_src_path, profile_dst_path)

avd_path = '/'.join([ANDROID_HOME, 'android_emulator'])
avd_path = '/'.join([ROOT, 'android_emulator'])
creation_cmd = 'avdmanager create avd -f -n {name} -b {img_type}/{sys_img} -k "system-images;android-{api_lvl};' \
'{img_type};{sys_img}" -d {device} -p {path}'.format(name=avd_name, img_type=IMG_TYPE,
sys_img=SYS_IMG,
Expand Down Expand Up @@ -226,10 +226,10 @@ def run():

if is_first_run:
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)
cmd = 'emulator @{name} -gpu swiftshader_indirect -accel on -wipe-data -writable-system -verbose {custom_args}'.format(name=avd_name, custom_args=custom_args)
else:
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)
cmd = '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:
Expand Down
6 changes: 0 additions & 6 deletions src/atd.sh

This file was deleted.

7 changes: 0 additions & 7 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ stdout_logfile=%(ENV_LOG_PATH)s/screen-copy.stdout.log
stderr_logfile=%(ENV_LOG_PATH)s/screen-copy.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
Expand Down

0 comments on commit d436eb3

Please sign in to comment.