Skip to content

Comments

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

Closed
ijc wants to merge 1 commit intoReactiveCircus:mainfrom
ijc:avoid-sudo-chown-on-Linux
Closed

Avoid sudo chown -R on ${ANDROID_HOME} on Linux#344
ijc wants to merge 1 commit intoReactiveCircus:mainfrom
ijc:avoid-sudo-chown-on-Linux

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