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

Automate detection of proxy variables for android build #405

Open
Blackclaws opened this issue Aug 2, 2023 · 0 comments
Open

Automate detection of proxy variables for android build #405

Blackclaws opened this issue Aug 2, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Blackclaws
Copy link

Context

Unity is pretty stupid when it comes to building for android behind a proxy (without any access to the internet without the proxy). See also this thread:

https://forum.unity.com/threads/request-proxy-settings-for-unity-hub.515447/

One needs to edit the sdkmanager script file directly in order to make it work, no environment variable setting works for passing those proxy variables into the sdkmanager that is called during the android build.

Android builds behind a proxy eventually succeed but it takes roughly 6 times longer (60 minutes vs 11) with all the extra time spent waiting for connection timeouts.

Suggested solution

Add the following to the Dockerfile for Unity:

find /opt/unity -name "sdkmanager" -exec sed -i 's/APP_ARGS"/APP_ARGS" ${SDKMANAGER_PROXY}/' {} \;

Also add something to the init files for android that does:

if [ -z ${PROXY_HOST+x} ]; then
  export SDKMANAGER_PROXY="--proxy=http --proxy_host="\$PROXY_HOST" --proxy_port="\$PROXY_PORT"
fi

If you'd like I can provide a pull request that does both of these things.

Considered alternatives

Manually doing that, which is what we are doing now.

@davidmfinol davidmfinol added the enhancement New feature or request label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants