### Installing Specific Android SDK Packages Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Installs a list of specified Android SDK packages using the `sdkmanager` tool. Package arguments are SDK-style paths, must be wrapped in quotes, and multiple packages are space-separated. ```console sdkmanager "extras;android;m2repository" "extras;google;m2repository" "extras;google;google_play_services" "extras;google;instantapps" "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" "build-tools;26.0.0" "platforms;android-26" ``` -------------------------------- ### Installing Essential Android SDK Packages Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command installs core Android SDK packages required for running emulators and using development tools. It includes platform tools, a specific Android platform version, and the emulator binary. ```console sdkmanager "platform-tools" "platforms;android-" "emulator" ``` -------------------------------- ### Listing Available Android SDK Images Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command lists all available emulator system images and other SDK packages from the remote SDK repository. Use it to identify necessary packages before installation. ```console sdkmanager --list --verbose ``` -------------------------------- ### Listing Android Tools Directory (Error Example) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command lists the contents of the Android command-line tools directory. It is used here as an example to show that the directory might be empty after a failed SDK update due to storage driver issues. ```bash ls $ANDROID_HOME/cmdline-tools/tools/ ``` -------------------------------- ### Listing Installed Android SDK Packages Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Lists the currently installed Android SDK packages using the `sdkmanager` tool. Provides a concise summary view of installed components. ```console sdkmanager --list ``` -------------------------------- ### Listing Installed Android SDK Packages Verbose Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Lists the currently installed Android SDK packages using `sdkmanager` with the `--verbose` flag. Displays full details including package paths, not truncating output. ```console sdkmanager --list --verbose ``` -------------------------------- ### Executing 'sdkmanager' Command (Error Example) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command attempts to run the 'sdkmanager' executable. It demonstrates the 'No such file or directory' error that can happen if the necessary SDK tools are missing, for instance after a failed update. ```bash sdkmanager ``` -------------------------------- ### Executing 'android' Command (Error Example) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command attempts to run the 'android' executable. It shows the 'command not found' error that can occur if the SDK tools were removed or corrupted during a failed update. ```bash android ``` -------------------------------- ### Example Docker Daemon Configuration Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This is a snippet from the Docker daemon configuration file (daemon.json) demonstrating how to explicitly set the storage driver. Modify this file to change the storage driver used by Docker. ```json { "storage-driver": "" } ``` -------------------------------- ### Running Container with Writable SDK Mount Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Run the container mounting the host's SDK directory with read/write permissions. Use this option only when you specifically need to update or install SDK components from inside the container. ```bash docker run -it -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash ``` -------------------------------- ### Executing Gradle Task (Mismatch Error Example) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Running a Gradle task like this can result in an AAPT process error if the Android SDK tools within the container were built for a different CPU architecture than the container's environment. ```bash gradle ``` -------------------------------- ### Building Android Application APK with Gradle Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Builds the application APK for a specified Android module using the Gradle wrapper. Requires an Android project with Gradle setup. The generated APK will be located in the module's build outputs directory, typically `/build/outputs/apk/`. ```console ./gradlew ::assemble ``` -------------------------------- ### Updating SDK on Host Volume Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Update or install specific Android SDK packages directly on the host machine using the `sdkmanager` binary from the persistent SDK volume. This requires Java Development Kit (JDK) to be installed on the host and is recommended only if the host architecture matches the container's. ```bash sdk/cmdline-tools/tools/bin/sdkmanager --update # or install specific packages sdk/cmdline-tools/tools/bin/sdkmanager "build-tools;x.y.z" "platforms;android-" ... ``` -------------------------------- ### Updating All Installed Android SDK Packages Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Updates all installed Android SDK packages to their latest available versions using the `sdkmanager` tool. Requires an active internet connection. ```console sdkmanager --update ``` -------------------------------- ### Checking Android SDK Platform Tools Version Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Checks the revision version of the installed Android SDK platform tools (like adb) by reading the source.properties file. Requires the ANDROID_HOME environment variable to be set. Uses standard shell commands `cat` and `grep`. ```console cat $ANDROID_HOME/platform-tools/source.properties | grep Pkg.Revision ``` -------------------------------- ### Checking Android SDK Command-line Tools Version Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Checks the revision version of the installed Android SDK command-line tools by reading the source.properties file. Requires the ANDROID_HOME environment variable to be set pointing to the SDK location. This uses standard shell commands `cat` and `grep`. ```console cat $ANDROID_HOME/cmdline-tools/tools/source.properties | grep Pkg.Revision ``` -------------------------------- ### Enabling Remote Docker API on macOS using Socat (Bash) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Sets up `socat` to forward TCP traffic on port 2376 to the Docker Unix socket `/var/run/docker.sock`. This enables remote access to the Docker API for CI purposes on macOS. Requires the `socat` utility to be installed. ```Bash socat TCP-LISTEN:2376,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the main Android SDK Docker image version 2.0. Notable changes include adding adb server launching on container start and upgrading Java, Gradle, and Kotlin compiler versions. ```console docker pull thyrlian/android-sdk:2.0 ``` -------------------------------- ### Stopping Android Emulator via ADB Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Stops a running Android emulator instance by sending a kill command via ADB. Requires the Android Debug Bridge (ADB) to be installed and the emulator's device serial number (``) to be known. ```console adb -s emu kill ``` -------------------------------- ### Copying Initial SDK to Host Volume Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Run a temporary container to copy the default SDK contents from the container's default location (`$ANDROID_HOME`) to a local directory (`$(pwd)/sdk`) mounted as a volume. This initializes the persistent SDK data on your host. ```bash docker run -it --rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk' ``` -------------------------------- ### Running Interactive Docker Container for Firebase Test Lab Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launches an interactive container for Firebase Test Lab, mounting volumes for the SDK, the Google Cloud service account private key, and the gcloud configuration directory. ```bash docker run -it -v $(pwd)/sdk:/opt/android-sdk -v /firebase.json:/root/firebase.json -v $(pwd)/gcloud-config:/root/.config/gcloud thyrlian/android-sdk-firebase-test-lab /bin/bash ``` -------------------------------- ### Building Android SDK Docker Image - With Args Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Build the Docker image while specifying versions for JDK, Gradle, Kotlin, and the Android SDK using build arguments. This allows customization of the included tools during the build process. ```bash docker build --build-arg JDK_VERSION= --build-arg GRADLE_VERSION= --build-arg KOTLIN_VERSION= --build-arg ANDROID_SDK_VERSION= -t android-sdk android-sdk ``` -------------------------------- ### Building Android SDK Docker Image - Basic Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command builds the Docker image from the Dockerfile located in the 'android-sdk' directory and tags it locally as 'android-sdk'. Execute this from the project's root directory. ```bash docker build -t android-sdk android-sdk ``` -------------------------------- ### Running Container with SDK and Gradle Cache Mounts Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launch the container mounting both the host's SDK directory and a local directory to persist and reuse Gradle caches. This significantly speeds up builds by avoiding repeated downloads of dependencies. ```bash docker run -it -v $(pwd)/sdk:/opt/android-sdk -v $(pwd)/gradle-caches:/root/.gradle/caches thyrlian/android-sdk /bin/bash ``` -------------------------------- ### Listing Existing Android Virtual Devices (avdmanager) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Use this command to list AVDs that have been created and are available for use. It provides details about each AVD's name, path, target, and ABI. ```bash avdmanager list avd ``` -------------------------------- ### Launching Android Emulator in Background Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command launches an AVD in the background (`&`). It includes options to disable audio, boot animation, and window display, enable acceleration, and disable GPU rendering for potentially better performance in headless environments. ```bash emulator -avd -no-audio -no-boot-anim -no-window -accel on -gpu off & ``` -------------------------------- ### Listing Supported Filesystems Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command lists the filesystems that are supported by the currently running Linux host kernel. It is useful for checking compatibility with various Docker storage drivers. ```console cat /proc/filesystems ``` -------------------------------- ### Listing Available Android Models on Firebase Test Lab Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command uses the `gcloud` CLI to list all available physical devices and emulators on Firebase Test Lab that can be used for testing. ```bash gcloud firebase test android models list ``` -------------------------------- ### Creating a New Android Virtual Device (AVD) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command creates a new AVD using the `avdmanager` tool. It pipes 'no' to bypass the configuration prompt, uses the `-n` flag for the AVD name, and the `-k` flag for the SDK image identifier. ```bash echo "no" | avdmanager create avd -n -k ``` -------------------------------- ### Listing Existing Android Virtual Devices (emulator) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Alternatively, this command can be used to list the names of existing AVDs. It's a simpler output compared to `avdmanager list avd`. ```bash emulator -list-avds ``` -------------------------------- ### Running UI Tests on Firebase Test Lab using gcloud CLI Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Executes UI tests on Firebase Test Lab using the gcloud command-line tool. Requires gcloud SDK configured and authenticated, and paths to the application (`--app`) and test (`--test`) APKs. Specifies test type, target devices, results directory, and GCP project ID. ```console gcloud firebase test android run $UI_TEST_APK $UI_TEST_DEVICES --type=$UI_TEST_TYPE --results-dir=$UI_TEST_RESULTS_DIR --project=$UI_TEST_PROJECT ``` -------------------------------- ### Downloading Android Emulator System Images Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Use this command to download specific Android system images required for creating Android Virtual Devices (AVDs). Replace placeholders with the desired image identifiers (e.g., 'system-images;android-24;default;x86'). ```bash sdkmanager "system_image_1" "system_image_2" ``` -------------------------------- ### Executing Docker Image Publisher Script (Console) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Executes the `image-publisher.sh` script located in the current directory. This script is responsible for building and publishing the Android SDK Docker image, taking an optional `[TAG]` argument to specify the version tag for the image. Requires the script to be executable. ```Console ./image-publisher.sh [TAG] ``` -------------------------------- ### Running Container with Read-Only SDK Mount Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launch the Docker container and mount the host's persistent SDK directory as a read-only volume (`:ro`). This is the recommended approach during typical development to prevent accidental modifications to the SDK from within the container. ```bash docker run -it -v $(pwd)/sdk:/opt/android-sdk:ro thyrlian/android-sdk /bin/bash ``` -------------------------------- ### Running Interactive Docker Container with ADB Port Exposed Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launches an interactive Docker container with the Android SDK VNC image, mapping the ADB port (5037) from the host to the container. This allows connecting to the container's ADB server. ```bash docker run -it -p 5037:5037 -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk-vnc /bin/bash ``` -------------------------------- ### Checking Emulator Acceleration Ability Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command checks if hardware acceleration (like KVM) is available and properly configured for the Android emulator within the current environment (e.g., inside a Docker container). ```bash emulator -accel-check ``` -------------------------------- ### Pulling Android SDK Docker Image Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Alternatively to building, you can pull the pre-built Docker image directly from Docker Hub. This downloads the image 'thyrlian/android-sdk' to your local machine. ```bash docker pull thyrlian/android-sdk ``` -------------------------------- ### Running Version Inspector Script in Docker (Console) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Reads the content of the `version-inspector.sh` script into a variable `cmd`. It then runs a new `android-sdk` Docker container, executes `bash -c "$cmd"` inside the container, effectively running the script. The container is interactive (`-it`) and removed upon exit (`--rm`). Useful for verifying tool versions within the built image. ```Console cmd=$(cat ./android-sdk/version-inspector.sh) && docker run -it --rm android-sdk bash -c "$cmd" ``` -------------------------------- ### Running Connected Android Tests via Gradle Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command executes Android UI tests (connected tests) on all currently attached and ready devices/emulators using the Gradle wrapper of your Android project. ```console /gradlew connectedAndroidTest ``` -------------------------------- ### Building Android Instrumented Tests APK with Gradle Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Builds the instrumented tests APK for a specified Android module using the Gradle wrapper. Requires an Android project with instrumented tests. The generated APK will be located in the module's build outputs directory for tests, typically `/build/outputs/apk/androidTest/`. ```console ./gradlew ::assembleAndroidTest ``` -------------------------------- ### Simulating OOM Exit Code 3 (SIGQUIT) with Docker/Java Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Demonstrates OOM termination with Exit Code 3 when the `-XX:+ExitOnOutOfMemoryError` JVM option is used. This option causes the JVM to exit immediately upon the first occurrence of an OutOfMemoryError. ```bash # spin up a container without memory limit docker run -it -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash # fill memory up cd /root/MemoryFiller && javac MemoryFiller.java # make sure that Docker memory resource is big enough > JVM max heap size # otherwise it's better to run with UnlockExperimentalVMOptions & UseCGroupMemoryLimitForHeap enabled java -XX:+ExitOnOutOfMemoryError MemoryFiller ``` -------------------------------- ### Connecting Host ADB Client to Container ADB Server Source: https://github.com/thyrlian/androidsdk/blob/master/README.md On the host machine, use this command to point the local ADB client to the ADB server running inside the specified Docker container, using the container's IP address and the exposed ADB port. ```bash adb connect :5037 ``` -------------------------------- ### Executing 'adb' Command (Exec Format Error) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Running the 'adb' command can also result in an 'Exec format error' if the binary was updated on a host machine with a different architecture than the container where it's being executed. ```bash adb ``` -------------------------------- ### Pulling Docker Image for Firebase Test Lab Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Downloads the specific Docker image pre-configured with the Google Cloud SDK and necessary components for interacting with Firebase Test Lab. ```bash docker pull thyrlian/android-sdk-firebase-test-lab ``` -------------------------------- ### Simulating OOM Exit Code 1 (SIGHUP) with Docker/Java Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Demonstrates OOM termination by the JVM itself (Exit 1) when Docker memory limits transparency is enabled. JVM correctly estimates its max heap size based on the container limit and throws a Java heap space OOM exception. ```bash # spin up a container with memory limit (or without - both lead to the same result) docker run -it -m 128m -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash # fill memory up # enable Docker memory limits transparency for JVM cd /root/MemoryFiller && javac MemoryFiller.java java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap MemoryFiller ``` -------------------------------- ### Running Docker Container with Specific Device Passthrough Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launches a Docker container and grants it access to a specific device file on the host (e.g., `/dev/ttyUSB0`) using the `--device` option, potentially avoiding the need for the full `--privileged` flag. ```console docker run -it --device=/dev/ttyUSB0 -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash ``` -------------------------------- ### Verifying Listening Ports using Netstat (Bash) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Uses the `netstat` command with options `-tulpn` to list all TCP/UDP ports that are in a listening state. The output is filtered using `grep LISTEN` to specifically show listening ports, allowing verification that the Docker remote API port (2376) is open after configuration changes. Requires root privileges (`sudo`). ```Bash sudo netstat -tulpn | grep LISTEN ``` -------------------------------- ### Executing AAPT Binary (Exec Format Error) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Directly executing the AAPT binary shows an 'Exec format error' when the binary was compiled for a different architecture than the one running the command. This is a consequence of updating the SDK on a host with a different architecture. ```bash $ANDROID_HOME/build-tools/x.x.x/aapt ``` -------------------------------- ### Running Docker Container with USB Device Passthrough (Privileged) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launches a Docker container with privileged access (`--privileged`) and mounts the host's USB bus (`/dev/bus/usb`), allowing Android devices connected via USB on the host to be accessible inside the container. ```console docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash ``` -------------------------------- ### Running Docker Container for Android SDK (Privileged) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This Docker command launches an interactive container with the Android SDK image. The `--privileged` flag is often required for KVM acceleration on x86 emulators. It mounts the host's SDK directory as read-only inside the container. ```bash docker run -it --privileged -v $(pwd)/sdk:/opt/android-sdk:ro thyrlian/android-sdk /bin/bash ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the initial release of the main Android SDK Docker image version 1.0. ```console docker pull thyrlian/android-sdk:1.0 ``` -------------------------------- ### Authenticating Google Cloud Service Account in Container Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Within the Firebase Test Lab container, this command activates a service account using its JSON private key file, granting the container access to Google Cloud services like Firebase Test Lab. ```bash gcloud auth activate-service-account -q --key-file /root/firebase.json ``` -------------------------------- ### Running Detached Docker Container for Firebase Test Lab (with SSH) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launches the Firebase Test Lab container in detached mode (`-d`), exposing SSH (2222), and mounting volumes for SDK, private key, gcloud config, and SSH authorized keys for remote access. ```bash docker run -d -p 2222:22 -v $(pwd)/sdk:/opt/android-sdk -v /firebase.json:/root/firebase.json -v $(pwd)/gcloud-config:/root/.config/gcloud -v $(pwd)/authorized_keys:/root/.ssh/authorized_keys thyrlian/android-sdk-firebase-test-lab ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.6 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the main Android SDK Docker image version 1.6. The main addition in this version is the inclusion of the Kotlin compiler. ```console docker pull thyrlian/android-sdk:1.6 ``` -------------------------------- ### Checking Docker Systemd Service Status and Location (Bash) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Executes the `systemctl status docker` command to display information about the Docker service. This includes its status, load state, and the path to its systemd unit file, which is useful for configuration modifications on Linux systems using systemd. ```Bash systemctl status docker #=> docker.service - Docker Application Container Engine #=> Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) ``` -------------------------------- ### Running Docker Container with ADB/SSH Ports Exposed Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Launches a Docker container with the Android SDK image and VNC/SSH capabilities. It maps port 5037 (ADB) and 2222 (SSH) from the host to the container, allowing external access. ```bash docker run -d -p 5037:5037 -p 2222:22 -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk-vnc ``` -------------------------------- ### Checking Connected Android Device/Emulator Status (adb) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command lists all Android devices or emulators connected to the ADB server. The output indicates the device's serial number and its status ('offline' while booting, 'device' when ready). ```bash adb devices ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.8 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to retrieve the main Android SDK Docker image version 1.8. This release includes upgrades to Gradle from 4.1 to 4.2.1 and the Kotlin compiler from 1.2-M2 to 1.1.51. ```console docker pull thyrlian/android-sdk:1.8 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.5 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to retrieve the main Android SDK Docker image version 2.5. This release includes upgrades to OpenJDK 1.8.0_191, Gradle 4.10.3, and Kotlin compiler 1.3.11. ```console docker pull thyrlian/android-sdk:2.5 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.5 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to retrieve the main Android SDK Docker image version 1.5. This version includes an applied fix for the emulator. ```console docker pull thyrlian/android-sdk:1.5 ``` -------------------------------- ### Increasing AVD RAM Size Source: https://github.com/thyrlian/androidsdk/blob/master/README.md This command appends or updates the `hw.ramSize` setting in the AVD's `config.ini` file, increasing the allocated RAM to the emulator. This can help resolve 'Process system isn't responding' errors. ```bash echo "hw.ramSize=1024" >> /root/.android/avd/.avd/config.ini ``` -------------------------------- ### Pulling Main Android SDK Docker Image 3.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the main Android SDK Docker image version 3.0. This release reduced image size and upgraded core components like Ubuntu to 18.04.2, Gradle to 5.2.1, and Kotlin compiler to 1.3.21. ```console docker pull thyrlian/android-sdk:3.0 ``` -------------------------------- ### Stopping/Removing Containers by Ancestor (Pulled Image) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Stop and remove all running containers that were created from the pulled 'thyrlian/android-sdk' image. The `&> /dev/null` part suppresses the output. ```bash docker stop $(docker ps -aqf "ancestor=thyrlian/android-sdk") &> /dev/null && docker rm $(docker ps -aqf "ancestor=thyrlian/android-sdk") &> /dev/null ``` -------------------------------- ### Simulating OOM Exit Code 137 (SIGKILL) with Docker/Java Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Demonstrates OOM termination by the kernel OOM killer (Exit 137) when a Java process's memory usage exceeds a container's memory limit without JVM-level Docker transparency. Executes a Java MemoryFiller class inside a memory-limited Docker container. ```bash # spin up a container with memory limit (128MB) docker run -it -m 128m -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash # fill memory up cd /root/MemoryFiller && javac MemoryFiller.java java MemoryFiller ``` -------------------------------- ### Modifying Docker Systemd Unit for Remote API (Bash) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Modifies the Docker systemd service file to include host bindings for both TCP (0.0.0.0:2376) and Unix socket. It uses `sed` to edit the `ExecStart` line, reloads the systemd daemon configuration, and restarts the Docker service for the changes to take effect. Requires root privileges (`sudo`). ```Bash sudo sed -i.bak 's?ExecStart.*?ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock?g' /lib/systemd/system/docker.service sudo systemctl daemon-reload sudo systemctl restart docker.service ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.7 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the main Android SDK Docker image version 1.7. Updates include upgrading Gradle to 4.1 and Kotlin compiler to 1.2-M2, as well as applying an emulator fix. ```console docker pull thyrlian/android-sdk:1.7 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.3 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the main Android SDK Docker image version 2.3. This release features upgrades to Gradle 4.8.1, Kotlin compiler 1.2.50, and AndroidSDK from 26.0.1 to 26.1.1. ```console docker pull thyrlian/android-sdk:2.3 ``` -------------------------------- ### Simulating OOM Exit Code 134 (SIGABRT) with Docker/Java Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Demonstrates OOM termination with Exit Code 134 (SIGABRT) when the `-XX:+CrashOnOutOfMemoryError` JVM option is used. This option causes the JVM to crash and generate an error report file (`hs_err_pid***.log`) upon encountering an OutOfMemoryError. ```bash # spin up a container without memory limit docker run -it -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash # fill memory up cd /root/MemoryFiller && javac MemoryFiller.java # make sure that Docker memory resource is big enough > JVM max heap size # otherwise it's better to run with UnlockExperimentalVMOptions & UseCGroupMemoryLimitForHeap enabled java -XX:+CrashOnOutOfMemoryError MemoryFiller ``` -------------------------------- ### Checking Docker Storage Driver Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Use this command to determine the current storage driver being utilized by the Docker daemon on the host machine. This information is relevant for understanding potential issues with AUFS and SDK updates. ```console docker info | grep 'Storage Driver' ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.1 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to retrieve the main Android SDK Docker image version 1.1. This version adds SSH server and necessary configurations. ```console docker pull thyrlian/android-sdk:1.1 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.1 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the main Android SDK Docker image version 2.1. This version primarily updates Gradle from 4.4.1 to 4.6 and the Kotlin compiler from 1.2.10 to 1.2.30. ```console docker pull thyrlian/android-sdk:2.1 ``` -------------------------------- ### Stopping/Removing Containers by Ancestor (Local Image) Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Stop and remove all running containers that were created from the locally built 'android-sdk' image. This is similar to the previous command but targets containers from the locally tagged image. ```bash docker stop $(docker ps -aqf "ancestor=android-sdk") &> /dev/null && docker rm $(docker ps -aqf "ancestor=android-sdk") &> /dev/null ``` -------------------------------- ### Killing Local ADB Server Source: https://github.com/thyrlian/androidsdk/blob/master/README.md Use this command on the host machine to stop the local ADB server. This is often necessary before connecting the ADB client to a remote ADB server (like the one in a Docker container) to ensure the correct server is being used. ```bash adb kill-server ``` -------------------------------- ### Pulling Main Android SDK Docker Image 4.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to retrieve the main Android SDK Docker image version 4.0. This release features upgrades such as Ubuntu 18.04.4, Gradle 6.3, Kotlin 1.3.71, and switching from AndroidSDK 26.1.1 to Android SDK Tools 1.0.0. ```console docker pull thyrlian/android-sdk:4.0 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.2 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the main Android SDK Docker image version 1.2. The primary change in this release is the upgrade of Gradle from 3.2.1 to 3.3. ```console docker pull thyrlian/android-sdk:1.2 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 5.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the main Android SDK Docker image version 5.0. Key updates in this version include upgrades to Ubuntu 20.04, OpenJDK 1.8.0_252, Gradle 6.4.1, and Android SDK Command-line Tools 2.0. ```console docker pull thyrlian/android-sdk:5.0 ``` -------------------------------- ### Pulling Android SDK VNC Sub-Image 6.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the VNC sub-image for the Android SDK Docker image version 6.0. This sub-image includes TightVNC version 1.3.10. ```console docker pull thyrlian/android-sdk-vnc:6.0 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 3.1 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the main Android SDK Docker image version 3.1. This version upgrades include Ubuntu 18.04.3, OpenJDK 1.8.0_242, Gradle 6.1.1, and Kotlin compiler 1.3.61. ```console docker pull thyrlian/android-sdk:3.1 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.3 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to retrieve the main Android SDK Docker image version 1.3. This version features upgrades to Gradle from 3.3 to 3.5 and the AndroidSDK from 25.2.3 to 26.0.1. ```console docker pull thyrlian/android-sdk:1.3 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.2 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to retrieve the main Android SDK Docker image version 2.2. Key changes include upgrading Ubuntu to 16.04.4, OpenJDK to 1.8.0_171, Gradle to 4.7, and Kotlin compiler to 1.2.41. ```console docker pull thyrlian/android-sdk:2.2 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.4 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the main Android SDK Docker image version 2.4. Updates in this version include upgrading Ubuntu to 16.04.5, OpenJDK to 1.8.0_181, Gradle to 4.10, and Kotlin compiler to 1.2.61. ```console docker pull thyrlian/android-sdk:2.4 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 6.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the Docker image for the main Android SDK version 6.0. This version includes upgraded components like Ubuntu 20.04.1, OpenJDK 1.8.0_272, Gradle 6.7, and Kotlin 1.4.10. ```console docker pull thyrlian/android-sdk:6.0 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 1.4 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Execute this command to pull the main Android SDK Docker image version 1.4. Key updates include upgrading Ubuntu from 16.04.1 to 16.04.2 and Gradle from 3.5 to 4.0. ```console docker pull thyrlian/android-sdk:1.4 ``` -------------------------------- ### Pulling Main Android SDK Docker Image 2.6 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md Use this command to pull the main Android SDK Docker image version 2.6. The primary change in this version is an upgrade of the base Ubuntu image from 16.04.5 to 16.04.6. ```console docker pull thyrlian/android-sdk:2.6 ``` -------------------------------- ### Pulling Android SDK Firebase Test Lab Sub-Image 6.0 Source: https://github.com/thyrlian/androidsdk/blob/master/CHANGELOG.md This command pulls the Firebase Test Lab sub-image for the Android SDK Docker image version 6.0. It includes Google Cloud SDK version 318.0.0. ```console docker pull thyrlian/android-sdk-firebase-test-lab:6.0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.