Skip to content

Commit 60f9df2

Browse files
committed
Simplify macOS Android SDK setup
1 parent 8ab9866 commit 60f9df2

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

.github/workflows/scripts-android.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,14 @@ jobs:
5858
- name: Install Android platform tools
5959
shell: bash
6060
run: |
61-
set -euxo pipefail
61+
set -eux
6262
if ! command -v sdkmanager >/dev/null 2>&1; then
6363
echo "sdkmanager executable is required" >&2
6464
exit 1
6565
fi
6666
67-
SDKMANAGER="$(command -v sdkmanager)"
68-
69-
run_sdk() {
70-
set +o pipefail
71-
local rc
72-
if arch -arm64 true 2>/dev/null; then
73-
yes | arch -arm64 "$SDKMANAGER" "$@" >/dev/null 2>&1
74-
rc=${PIPESTATUS[2]}
75-
else
76-
yes | "$SDKMANAGER" "$@" >/dev/null 2>&1
77-
rc=${PIPESTATUS[1]}
78-
fi
79-
set -o pipefail
80-
return $rc
81-
}
82-
83-
run_sdk --licenses
84-
run_sdk --install "platform-tools" "build-tools;34.0.0"
85-
run_sdk --install "platforms;android-33" || echo "Warning: failed to install Android 33 platform" >&2
67+
yes 2>/dev/null | sdkmanager --licenses >/dev/null
68+
yes 2>/dev/null | sdkmanager --install "platform-tools" "build-tools;34.0.0" "platforms;android-33" >/dev/null
8669
8770
if [ -n "${ANDROID_HOME:-}" ] && [ -d "${ANDROID_HOME}/platform-tools" ]; then
8871
echo "${ANDROID_HOME}/platform-tools" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)