Skip to content
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

Avoid sudo chown -R on ${ANDROID_HOME} on Linux #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ijc
Copy link

@ijc ijc commented Jul 10, 2023

This seems to take several minutes, a decent fraction of the overall time in my
simple use.

Instead of changing the ownership of ${ANDROID_HOME} instead arrange to run
individual commands under sudo when needed.

Note that $PATH is not preserved by sudo so we must use the full path to
the sdkmanager.

Another wrinkle is the cmdline-tools installation, since tc.extractZip and
io.mv do not include sudo-ish functionality. Instead precreate the target
directory with the ownership to allow the unpack as the current user.

@ijc ijc force-pushed the avoid-sudo-chown-on-Linux branch from d597ec0 to fda9df2 Compare July 10, 2023 14:34
This seems to take several minutes, a decent fraction of the overall time in my
simple use.

Instead of changing the ownership of `${ANDROID_HOME}` instead arrange to run
individual commands under `sudo` when needed.

Note that `$PATH` is not preserved by `sudo` so we must use the full path to
the `sdkmanager`.

Another wrinkle is the cmdline-tools installation, since `tc.extractZip` and
`io.mv` do not include sudo-ish functionality. Instead precreate the target
directory with the ownership to allow the unpack as the current user.
@ijc ijc force-pushed the avoid-sudo-chown-on-Linux branch from fda9df2 to e994454 Compare July 11, 2023 07:06
Copy link

@jonatasteixeira jonatasteixeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants