2 #===----------------------------------------------------------------------===##
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
8 #===----------------------------------------------------------------------===##
10 # Starts a new Docker container using a Docker image containing the Android
11 # Emulator and an OS image. Stops and removes the old container if it exists
16 THIS_DIR
="$(cd "$
(dirname "$0")" && pwd)"
17 .
"${THIS_DIR}/emulator-functions.sh"
20 if ! validate_emu_img
"${EMU_IMG}"; then
21 echo "error: The first argument must be a valid emulator image." >&2
25 "${THIS_DIR}/stop-emulator.sh"
27 # Start the container.
28 docker run
--name libcxx-ci-android-emulator
--detach --device /dev
/kvm \
29 -eEMU_PARTITION_SIZE=8192 \
30 --volume android-platform-tools
:/mnt
/android-platform-tools \
31 $
(docker_image_of_emu_img
${EMU_IMG})
33 docker
exec libcxx-ci-android-emulator emulator-wait-for-ready.sh || ERR
=${?}
34 echo "Emulator container initial logs:"
35 docker logs libcxx-ci-android-emulator
36 if [ ${ERR} != 0 ]; then
40 # Make sure the device is accessible from outside the emulator container and
41 # advertise to the user that this script exists.
42 .
"${THIS_DIR}/setup-env-for-emulator.sh"