Skip to content

Commit 305841a

Browse files
jardondiegoDiego Jardon
andauthored
Update Android SDK tools and bundled binaries (#5279)
This pull request updates the Android toolchain to modern versions to fix compatibility issues and improve stability. ### Changes: - Replaced the deprecated `sdk-tools-linux` with modern `commandlinetools-linux` (Revision 11076708) in `local/install_python_deps_linux.bash`. - Updated the installation script to handle the new `cmdline-tools` directory structure. - Bumped the default Android emulator API level to 34 (x86_64) for improved performance and stability. - Updated bundled `adb` and `fastboot` binaries to version 37.0.0. ### Impact: - Fixes `java.lang.NoClassDefFoundError` on systems using Java 11+. - Prevents ADB server version mismatches and constant disconnections when running local emulators. - Provides a more robust and performant environment for Android fuzzing. --------- Co-authored-by: Diego Jardon <jardondiego@google.com>
1 parent aec4e59 commit 305841a

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

local/install_python_deps_linux.bash

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,29 @@ source "$(${PYTHON} -m pipenv --venv)/bin/activate"
2727

2828
if [ $install_android_emulator ]; then
2929
ANDROID_SDK_INSTALL_DIR=local/bin/android-sdk
30-
ANDROID_SDK_REVISION=4333796
31-
ANDROID_VERSION=28
32-
ANDROID_TOOLS_BIN=$ANDROID_SDK_INSTALL_DIR/tools/bin/
30+
ANDROID_SDK_REVISION=11076708
31+
ANDROID_VERSION=34
32+
ANDROID_TOOLS_BIN=$ANDROID_SDK_INSTALL_DIR/cmdline-tools/latest/bin/
3333

3434
# Install the Android emulator and its dependencies. Used in tests and as an
3535
# option during Android test case reproduction.
3636
rm -rf $ANDROID_SDK_INSTALL_DIR
37-
mkdir $ANDROID_SDK_INSTALL_DIR
38-
curl https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_REVISION.zip \
39-
--output $ANDROID_SDK_INSTALL_DIR/sdk-tools-linux.zip
40-
unzip -d $ANDROID_SDK_INSTALL_DIR $ANDROID_SDK_INSTALL_DIR/sdk-tools-linux.zip
37+
mkdir -p $ANDROID_SDK_INSTALL_DIR
38+
curl https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_REVISION}_latest.zip \
39+
--output $ANDROID_SDK_INSTALL_DIR/cmdline-tools.zip
40+
unzip -d $ANDROID_SDK_INSTALL_DIR/temp $ANDROID_SDK_INSTALL_DIR/cmdline-tools.zip
41+
42+
# The new cmdline-tools expects to be in a directory named 'latest' or 'version'
43+
# to find its own root.
44+
mkdir -p $ANDROID_SDK_INSTALL_DIR/cmdline-tools
45+
mv $ANDROID_SDK_INSTALL_DIR/temp/cmdline-tools $ANDROID_SDK_INSTALL_DIR/cmdline-tools/latest
46+
rmdir $ANDROID_SDK_INSTALL_DIR/temp
4147

48+
yes | $ANDROID_TOOLS_BIN/sdkmanager --licenses
4249
$ANDROID_TOOLS_BIN/sdkmanager "emulator"
43-
$ANDROID_TOOLS_BIN/sdkmanager "platform-tools" "platforms;android-$ANDROID_VERSION"
44-
$ANDROID_TOOLS_BIN/sdkmanager "system-images;android-$ANDROID_VERSION;google_apis;x86"
45-
$ANDROID_TOOLS_BIN/sdkmanager --licenses
46-
$ANDROID_TOOLS_BIN/avdmanager create avd --force -n TestImage -k "system-images;android-$ANDROID_VERSION;google_apis;x86"
50+
$ANDROID_TOOLS_BIN/sdkmanager "platform-tools" "platforms;android-$ANDROID_VERSION" "build-tools;$ANDROID_VERSION.0.0"
51+
$ANDROID_TOOLS_BIN/sdkmanager "system-images;android-$ANDROID_VERSION;google_apis;x86_64"
52+
$ANDROID_TOOLS_BIN/avdmanager create avd --force -n TestImage -k "system-images;android-$ANDROID_VERSION;google_apis;x86_64"
4753
fi
4854

4955
# Install other dependencies (e.g. bower).

resources/platform/android/adb

8.04 MB
Binary file not shown.
1.03 MB
Binary file not shown.

0 commit comments

Comments
 (0)