mattermost-mobile/detox/create_android_emulator.sh
Saturnino Abril 6cf94d7be6
Detox/E2E: Update android emulator using Pixel 4 XL (#5354)
* update android emulator using Pixel 4 XL for detox tests

* update per comment
2021-04-28 06:56:30 +08:00

19 lines
644 B
Bash
Executable file

#!/bin/bash
set -ex
set -o pipefail
NAME=detox_pixel_4_xl_api_30
if emulator -list-avds | grep -q $NAME; then
echo "'${NAME}' Android virtual device already exists."
else
# Create virtual device in a relative "detox_pixel_4_xl_api_30" folder
avdmanager create avd -n $NAME -k 'system-images;android-30;google_apis;x86' -g google_apis -p $NAME -d 'pixel'
# Copy predefined config and skin
cp -r android_emulator/ $NAME/
sed -i -e "s|skin.path = /change_to_absolute_path/pixel_4_xl_skin|skin.path = $(pwd)/${NAME}/pixel_4_xl_skin|g" $NAME/config.ini
echo "Android virtual device successfully created: ${NAME}"
fi