diff --git a/README.md b/README.md index 8917a5f8..a85a5d8e 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,8 @@ It does the following: - The gRPC service is used to communicate with the running emulator inside the container. +*Note: You can use a public adbkey by injecting the ADBKEY_PUB variable, i.e.: -e ADBKEY_PUB="$(cat ~/.android/adbkey.pub)"* + You also have the option to mount a /data partition which the emulator will use if available. This enables you to use a tmpfs which can give increased performance, especially in the nested virtualization scenario. diff --git a/emu/templates/Dockerfile.emulator b/emu/templates/Dockerfile.emulator index c9034220..82411c87 100644 --- a/emu/templates/Dockerfile.emulator +++ b/emu/templates/Dockerfile.emulator @@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libpulse0 libtinfo5 libx11-6 libxcb1 libxdamage1 \ libnss3 libxcomposite1 libxcursor1 libxi6 \ libxext6 libxfixes3 zlib1g libgl1 pulseaudio socat \ + iputils-ping \ # Enable turncfg through usage of curl curl ca-certificates && \ apt-get clean && \ diff --git a/emu/templates/launch-emulator.sh b/emu/templates/launch-emulator.sh index a31b0e04..cb4ee1bb 100644 --- a/emu/templates/launch-emulator.sh +++ b/emu/templates/launch-emulator.sh @@ -112,6 +112,9 @@ install_adb_keys() { echo "-----BEGIN PRIVATE KEY-----" >/root/.android/adbkey echo $ADBKEY | tr " " "\\n" | sed -n "4,29p" >>/root/.android/adbkey echo "-----END PRIVATE KEY-----" >>/root/.android/adbkey + elif [ ! -z "${ADBKEY_PUB}" ]; then + echo "emulator: Using provided adb public key" + echo $ADBKEY_PUB >>/root/.android/adbkey.pub else echo "emulator: No adb key provided, creating internal one, you might not be able connect from adb." run /android/sdk/platform-tools/adb keygen /root/.android/adbkey @@ -219,6 +222,7 @@ var_append LAUNCH_CMD -avd Pixel2 var_append LAUNCH_CMD -ports 5556,5557 -grpc 8554 -no-window var_append LAUNCH_CMD -skip-adb-auth -no-snapshot-save -wipe-data -no-boot-anim var_append LAUNCH_CMD -shell-serial file:/tmp/android-unknown/kernel.log +var_append LAUNCH_CMD -logcat "*:V" var_append LAUNCH_CMD -logcat-output /tmp/android-unknown/logcat.log var_append LAUNCH_CMD -logcat "*:V" var_append LAUNCH_CMD -feature AllowSnapshotMigration