Skip to content

README include cmdline-tools in path to sdkmanager #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ Previously, running Android SDK update within the **Dockerfile** or inside a **c
What happens if the update fails?

```bash
ls $ANDROID_SDK_ROOT/tools/
ls $ANDROID_SDK_ROOT/cmdline-tools/tools/
#=> empty, nothing is there
# tools such as: android, sdkmanager, emulator, lint and etc. are gone

android
#=> bash: android: command not found

sdkmanager
#=> bash: /opt/android-sdk/tools/bin/sdkmanager: No such file or directory
#=> bash: /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager: No such file or directory
```

To prevent this problem from happening, and you don't wanna bother modifying storage driver. The only solution is to mount an external SDK volume from host to container. Then you are free to try any of below approaches.
Expand Down Expand Up @@ -132,9 +132,9 @@ docker run -it --rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDR
# go to the 'sdk' directory on the host, update the SDK
# ONLY IF the host machine is the same target architecture as the container
# JDK required on the host
sdk/tools/bin/sdkmanager --update
sdk/cmdline-tools/tools/bin/sdkmanager --update
# or install specific packages
sdk/tools/bin/sdkmanager "build-tools;x.y.z" "platforms;android-<api_level>" ...
sdk/cmdline-tools/tools/bin/sdkmanager "build-tools;x.y.z" "platforms;android-<api_level>" ...

# mount the updated SDK to container again
# if the host SDK directory is mounted to more than one container
Expand Down Expand Up @@ -676,7 +676,7 @@ To learn more about Firebase Test Lab and Google Cloud SDK, please go and visit
cat $ANDROID_SDK_ROOT/platform-tools/source.properties | grep Pkg.Revision
```

> The "`android`" command is deprecated. For command-line tools, use `tools/bin/sdkmanager` and `tools/bin/avdmanager`.
> The "`android`" command is deprecated. For command-line tools, use `cmdline-tools/tools/bin/sdkmanager` and `cmdline-tools/tools/bin/avdmanager`.

* List installed and available packages

Expand Down