Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
GertSallaerts committed Aug 24, 2022
1 parent 8c8b9bd commit 8fd55d6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions apps/bare-expo/scripts/create-emulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ API_LEVEL=$1
emulator_name="bare-expo"
ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-$ANDROID_HOME}

if $ANDROID_SDK_ROOT/tools/android list avd | grep -q $emulator_name; then
if $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager list avd | grep -q $emulator_name; then
echo " ☛ Found an existing an emulator named ${emulator_name}"
exit 0;
fi
Expand All @@ -24,10 +24,10 @@ then
fi

echo " ☛ Downloading the Android image to create an emulator..."
echo no | $ANDROID_SDK_ROOT/tools/bin/sdkmanager $PACKAGE
echo no | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager $PACKAGE

echo " ☛ Creating the emulator..."
echo no | $ANDROID_SDK_ROOT/tools/bin/avdmanager \
echo no | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager \
--verbose \
create avd \
--force \
Expand Down
46 changes: 23 additions & 23 deletions apps/bare-expo/scripts/start-emulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ echo " ☛ Bootstrapping Expo in ${CURRENT_ENV} mode"

"$DIR/setup-android-project.sh"

if ! $ANDROID_SDK_ROOT/tools/android list avd | grep -q bare-expo; then
echo " ⚠️ No emulator for bare Expo found, creating one..."
$DIR/create-emulator.sh 22
fi

if $ANDROID_SDK_ROOT/platform-tools/adb devices -l | grep -q emulator; then
echo " ✅ Emulator is already running"
else
echo " ⚠️ Starting emulator..."
echo "no" | $ANDROID_SDK_ROOT/emulator/emulator "-avd" "bare-expo" "-skin" "480x800" "-no-audio" "-no-boot-anim" "-port" "5554" "-no-snapshot" "-partition-size" "1024" &

$DIR/wait-for-emulator.sh
sleep 30

$ANDROID_SDK_ROOT/platform-tools/adb wait-for-device
$ANDROID_SDK_ROOT/platform-tools/adb shell settings put global window_animation_scale 0
$ANDROID_SDK_ROOT/platform-tools/adb shell settings put global transition_animation_scale 0
$ANDROID_SDK_ROOT/platform-tools/adb shell settings put global animator_duration_scale 0
$ANDROID_SDK_ROOT/platform-tools/adb shell am broadcast -a android.intent.action.BOOT_COMPLETED &

sleep 5
echo " ✅ Emulator is running"
fi
# if ! $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager list avd | grep -q bare-expo; then
# echo " ⚠️ No emulator for bare Expo found, creating one..."
# $DIR/create-emulator.sh 22
# fi

# if $ANDROID_SDK_ROOT/platform-tools/adb devices -l | grep -q emulator; then
# echo " ✅ Emulator is already running"
# else
# echo " ⚠️ Starting emulator..."
# echo "no" | $ANDROID_SDK_ROOT/emulator/emulator "-avd" "bare-expo" "-skin" "480x800" "-no-audio" "-no-boot-anim" "-port" "5554" "-no-snapshot" "-partition-size" "1024" &

# $DIR/wait-for-emulator.sh
# sleep 30

# $ANDROID_SDK_ROOT/platform-tools/adb wait-for-device
# $ANDROID_SDK_ROOT/platform-tools/adb shell settings put global window_animation_scale 0
# $ANDROID_SDK_ROOT/platform-tools/adb shell settings put global transition_animation_scale 0
# $ANDROID_SDK_ROOT/platform-tools/adb shell settings put global animator_duration_scale 0
# $ANDROID_SDK_ROOT/platform-tools/adb shell am broadcast -a android.intent.action.BOOT_COMPLETED &

# sleep 5
# echo " ✅ Emulator is running"
# fi

$DIR/start-metro.sh $port

Expand Down

0 comments on commit 8fd55d6

Please sign in to comment.