Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccarthyIrl committed Mar 9, 2024
1 parent b0847ac commit d639f84
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/scripts/startEmulator.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#!/bin/bash

# Install Android SDK Platform Tools if not already installed
echo "Install Android SDK Platform Tools if not already installed..."
if ! command -v adb &> /dev/null; then
echo "Installing Android SDK Platform Tools..."
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "platform-tools" --verbose > /dev/null
fi

# Find adb executable
ADB=$(find $ANDROID_HOME -name adb -type f -print -quit)
ADB=$(find "$ANDROID_HOME" -name adb -type f -print -quit)

if [ -z "$ADB" ]; then
echo "ADB not found in $ANDROID_HOME or its subdirectories."
exit 1
fi

# Start emulator
# Start emulator in the background
echo "Start emulator in the background..."
nohup $EMULATOR -avd testRunner \
-skin 1080x1920 \
-no-snapshot \
Expand All @@ -25,10 +27,11 @@ nohup $EMULATOR -avd testRunner \
-qemu -lcd-density 420 > /dev/null 2>&1 &

# Wait for device to boot completely
echo "Waiting for the device to boot..."
$ADB wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done'

# List connected devices
echo "Connected Devices:"
$ADB devices > /dev/null
$ADB devices

echo "Emulator started"

0 comments on commit d639f84

Please sign in to comment.