Skip to content

Commit

Permalink
ci: fix emulator config props
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Oct 2, 2024
1 parent fe0ae4e commit c43c417
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions build/scripts/android-uitest-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit c43c417

Please sign in to comment.