xref: /aosp_15_r20/external/cronet/third_party/libc++/src/utils/ci/vendor/android/container-setup.sh (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1#!/usr/bin/env bash
2#===----------------------------------------------------------------------===##
3#
4# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5# See https://llvm.org/LICENSE.txt for license information.
6# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7#
8#===----------------------------------------------------------------------===##
9
10set -e
11
12# Different versions of adb can sometimes be incompatible (i.e. "adb server
13# version (nn) doesn't match this client (mm); killing..."). Ensure that the adb
14# in the main builder image matches that in the emulator by sharing the
15# platform-tools from the main image.
16if [ -d /mnt/android-platform-tools ]; then
17    sudo rm -fr /mnt/android-platform-tools/platform-tools
18    sudo cp -r /opt/android/sdk/platform-tools /mnt/android-platform-tools
19fi
20