Switch ANDROID_SDK_HOME to ANDROID_HOME
This commit is contained in:
parent
29bd71bcc9
commit
ced8803761
5 changed files with 22 additions and 22 deletions
|
@ -191,7 +191,7 @@ tasks.register('provisionEmulator', Exec) {
|
||||||
"seedvault",
|
"seedvault",
|
||||||
"system-images;android-33;google_apis;x86_64"
|
"system-images;android-33;google_apis;x86_64"
|
||||||
|
|
||||||
environment "ANDROID_SDK_HOME", android.sdkDirectory.absolutePath
|
environment "ANDROID_HOME", android.sdkDirectory.absolutePath
|
||||||
environment "JAVA_HOME", System.properties['java.home']
|
environment "JAVA_HOME", System.properties['java.home']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ tasks.register('startEmulator', Exec) {
|
||||||
doFirst {
|
doFirst {
|
||||||
commandLine "${project.projectDir}/development/scripts/start_emulator.sh", "seedvault"
|
commandLine "${project.projectDir}/development/scripts/start_emulator.sh", "seedvault"
|
||||||
|
|
||||||
environment "ANDROID_SDK_HOME", android.sdkDirectory.absolutePath
|
environment "ANDROID_HOME", android.sdkDirectory.absolutePath
|
||||||
environment "JAVA_HOME", System.properties['java.home']
|
environment "JAVA_HOME", System.properties['java.home']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ tasks.register('installEmulatorRelease', Exec) {
|
||||||
doFirst {
|
doFirst {
|
||||||
commandLine "${project.projectDir}/development/scripts/install_app.sh"
|
commandLine "${project.projectDir}/development/scripts/install_app.sh"
|
||||||
|
|
||||||
environment "ANDROID_SDK_HOME", android.sdkDirectory.absolutePath
|
environment "ANDROID_HOME", android.sdkDirectory.absolutePath
|
||||||
environment "JAVA_HOME", System.properties['java.home']
|
environment "JAVA_HOME", System.properties['java.home']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ tasks.register('clearEmulatorAppData', Exec) {
|
||||||
doFirst {
|
doFirst {
|
||||||
commandLine "${project.projectDir}/development/scripts/clear_app_data.sh"
|
commandLine "${project.projectDir}/development/scripts/clear_app_data.sh"
|
||||||
|
|
||||||
environment "ANDROID_SDK_HOME", android.sdkDirectory.absolutePath
|
environment "ANDROID_HOME", android.sdkDirectory.absolutePath
|
||||||
environment "JAVA_HOME", System.properties['java.home']
|
environment "JAVA_HOME", System.properties['java.home']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# assert ANDROID_HOME is set
|
# assert ANDROID_HOME is set
|
||||||
if [ -z "$ANDROID_SDK_HOME" ]; then
|
if [ -z "$ANDROID_HOME" ]; then
|
||||||
echo "ANDROID_SDK_HOME is not set"
|
echo "ANDROID_HOME is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -10,13 +10,13 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
DEVELOPMENT_DIR=$SCRIPT_DIR/..
|
DEVELOPMENT_DIR=$SCRIPT_DIR/..
|
||||||
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
||||||
|
|
||||||
EMULATOR_DEVICE_NAME=$($ANDROID_SDK_HOME/platform-tools/adb devices | grep emulator | cut -f1)
|
EMULATOR_DEVICE_NAME=$($ANDROID_HOME/platform-tools/adb devices | grep emulator | cut -f1)
|
||||||
|
|
||||||
if [ -z "$EMULATOR_DEVICE_NAME" ]; then
|
if [ -z "$EMULATOR_DEVICE_NAME" ]; then
|
||||||
echo "Emulator device name not found"
|
echo "Emulator device name not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ADB="$ANDROID_SDK_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
|
ADB="$ANDROID_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
|
||||||
|
|
||||||
$ADB shell pm clear com.stevesoltys.seedvault
|
$ADB shell pm clear com.stevesoltys.seedvault
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# assert ANDROID_HOME is set
|
# assert ANDROID_HOME is set
|
||||||
if [ -z "$ANDROID_SDK_HOME" ]; then
|
if [ -z "$ANDROID_HOME" ]; then
|
||||||
echo "ANDROID_SDK_HOME is not set"
|
echo "ANDROID_HOME is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -10,14 +10,14 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
DEVELOPMENT_DIR=$SCRIPT_DIR/..
|
DEVELOPMENT_DIR=$SCRIPT_DIR/..
|
||||||
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
||||||
|
|
||||||
EMULATOR_DEVICE_NAME=$($ANDROID_SDK_HOME/platform-tools/adb devices | grep emulator | cut -f1)
|
EMULATOR_DEVICE_NAME=$($ANDROID_HOME/platform-tools/adb devices | grep emulator | cut -f1)
|
||||||
|
|
||||||
if [ -z "$EMULATOR_DEVICE_NAME" ]; then
|
if [ -z "$EMULATOR_DEVICE_NAME" ]; then
|
||||||
echo "Emulator device name not found"
|
echo "Emulator device name not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ADB="$ANDROID_SDK_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
|
ADB="$ANDROID_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
|
||||||
|
|
||||||
$ADB root
|
$ADB root
|
||||||
sleep 3 # wait for adb to restart
|
sleep 3 # wait for adb to restart
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# assert ANDROID_HOME is set
|
# assert ANDROID_HOME is set
|
||||||
if [ -z "$ANDROID_SDK_HOME" ]; then
|
if [ -z "$ANDROID_HOME" ]; then
|
||||||
echo "ANDROID_SDK_HOME is not set"
|
echo "ANDROID_HOME is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -20,14 +20,14 @@ DEVELOPMENT_DIR=$SCRIPT_DIR/..
|
||||||
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
||||||
|
|
||||||
echo "Downloading system image..."
|
echo "Downloading system image..."
|
||||||
$ANDROID_SDK_HOME/cmdline-tools/latest/bin/sdkmanager --install "$SYSTEM_IMAGE"
|
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "$SYSTEM_IMAGE"
|
||||||
|
|
||||||
# create AVD if it doesn't exist
|
# create AVD if it doesn't exist
|
||||||
if $ANDROID_SDK_HOME/cmdline-tools/latest/bin/avdmanager list avd | grep -q "$EMULATOR_NAME"; then
|
if $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list avd | grep -q "$EMULATOR_NAME"; then
|
||||||
echo "AVD already exists. Skipping creation."
|
echo "AVD already exists. Skipping creation."
|
||||||
else
|
else
|
||||||
echo "Creating AVD..."
|
echo "Creating AVD..."
|
||||||
echo 'no' | $ANDROID_SDK_HOME/cmdline-tools/latest/bin/avdmanager create avd -n "$EMULATOR_NAME" -k "$SYSTEM_IMAGE"
|
echo 'no' | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n "$EMULATOR_NAME" -k "$SYSTEM_IMAGE"
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -35,14 +35,14 @@ $SCRIPT_DIR/start_emulator.sh "$EMULATOR_NAME"
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
# get emulator device name from ADB
|
# get emulator device name from ADB
|
||||||
EMULATOR_DEVICE_NAME=$($ANDROID_SDK_HOME/platform-tools/adb devices | grep emulator | cut -f1)
|
EMULATOR_DEVICE_NAME=$($ANDROID_HOME/platform-tools/adb devices | grep emulator | cut -f1)
|
||||||
|
|
||||||
if [ -z "$EMULATOR_DEVICE_NAME" ]; then
|
if [ -z "$EMULATOR_DEVICE_NAME" ]; then
|
||||||
echo "Emulator device name not found"
|
echo "Emulator device name not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ADB="$ANDROID_SDK_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
|
ADB="$ANDROID_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
|
||||||
|
|
||||||
echo "Waiting for emulator to boot..."
|
echo "Waiting for emulator to boot..."
|
||||||
$ADB wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
|
$ADB wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# assert ANDROID_HOME is set
|
# assert ANDROID_HOME is set
|
||||||
if [ -z "$ANDROID_SDK_HOME" ]; then
|
if [ -z "$ANDROID_HOME" ]; then
|
||||||
echo "ANDROID_SDK_HOME is not set"
|
echo "ANDROID_HOME is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -19,4 +19,4 @@ DEVELOPMENT_DIR=$SCRIPT_DIR/..
|
||||||
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
ROOT_PROJECT_DIR=$SCRIPT_DIR/../../..
|
||||||
|
|
||||||
echo "Starting emulator..."
|
echo "Starting emulator..."
|
||||||
nohup $ANDROID_SDK_HOME/emulator/emulator -avd "$EMULATOR_NAME" -gpu swiftshader_indirect -writable-system -no-snapshot-load >/dev/null 2>&1 &
|
nohup $ANDROID_HOME/emulator/emulator -avd "$EMULATOR_NAME" -gpu swiftshader_indirect -writable-system -no-snapshot-load >/dev/null 2>&1 &
|
||||||
|
|
Loading…
Reference in a new issue