diff --git a/build/scripts/android-uitest-run.sh b/build/scripts/android-uitest-run.sh index 65cc9ba48..961cd896b 100644 --- a/build/scripts/android-uitest-run.sh +++ b/build/scripts/android-uitest-run.sh @@ -59,19 +59,31 @@ then # based on https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#hardware # >> Agents that run macOS images are provisioned on Mac pros with a 3 core CPU, 14 GB of RAM, and 14 GB of SSD disk space. - echo "hw.cpu.ncore=3" >> $AVD_CONFIG_FILE - + CORES=3 # Bump the heap size as the tests are stressing the application - echo "vm.heapSize=256M" >> $AVD_CONFIG_FILE + HEAP=256M + + # set up for Linux or macOS + OS="$(uname -s)" + echo "Running on $OS" + if [[ $OS == "Linux" ]]; then + SED_I_CMD="sed -i " + elif [[ $OS == "Darwin" ]]; then + SED_I_CMD="sed -i ''" + else + echo "ERROR: this does not work on $OS" + exit + fi - echo $ANDROID_HOME/emulator/emulator -list-avds + echo "CHANGE: vm.heapSize=$HEAP & hw.cpu.ncore=$CORES in $AVD_CONFIG_FILE" + $SED_I_CMD '/^hw.cpu.ncore/d' $AVD_CONFIG_FILE + $SED_I_CMD '/^vm.heapSize/d' $AVD_CONFIG_FILE + echo "vm.heapSize=$HEAP" >> $AVD_CONFIG_FILE + echo "hw.cpu.ncore=$CORES" >> $AVD_CONFIG_FILE + cat $AVD_CONFIG_FILE | grep "hw.cpu.ncore" + cat $AVD_CONFIG_FILE | grep "vm.heapSize" - cat $AVD_CONFIG_FILE - if [ ! -f "~/.android/avd/$AVD_NAME.ini" ]; - then - echo "found avd .ini file" - cat ~/.android/avd/$AVD_NAME.ini - fi + echo $ANDROID_HOME/emulator/emulator -list-avds echo "Starting emulator"