mirror of
https://github.com/budtmo/docker-android.git
synced 2026-04-25 20:25:57 +03:00
[GH-ISSUE #78] Automate proxy configuration inside Android Emulator #61
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/docker-android#61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kurisutian on GitHub (Jun 12, 2018).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/78
Operating System:
Debian 8
Docker Image:
butomo1989/docker-android-x86-7.1.1
Docker Version:
17.12.1-ce
Docker Command to start docker-android:
Running everything through Rancher
Expected Behavior
I'm running all emulators behind our corporate proxy.
When entering this as "HTTP_PROXY" and "HTTPS_PROXY" as well as different values for "NO_PROXY" I thought I can access everything from the emulator(s) like I would with other containers for automated testing (Desktop Browser Nodes from Selenium). It should work similar.
Actual Behavior
When entering the proxy information from our company, I can access websites using curl within the container but the android emulator does not open these very same sites (checked with www.google.de). Instead of showing me any site in the "device" I cannot get any outside connection.
Checked this with the bridge IP as well as our corporate proxy, nothing worked so far.
@budtmo commented on GitHub (Jul 5, 2018):
Hi @Kurisutian ,
you can set up the proxy inside emulator manually. I just tested this article and it works. I am not sure if we can automate it by using adb command. :(
It would be great if you can help to investigate it @Kurisutian
@Kurisutian commented on GitHub (Jul 5, 2018):
Hi @butomo1989 ,
thanks for your reply. The problem I have with the manual config is, we intend to run a couple of these containers (>40) for automated testing and manually doing that is just to much of a hassle. We might scale up and down as well so we need to do it automatically.
Also I noticed when running the containers after a while there are so many defuntc adb processes that the container will take down the complete docker daemon on the host running. Did you ever experience something like that? It happened all the time so we needed to stop using the containers for now to prevent the host going down with other containers running on it as well.
If there is anything I can do to help investigate, let me know and I can do my best to support. Thanks!
@JoeSSS commented on GitHub (Jul 5, 2018):
I experienced it, that's why I limit the container to max 30 minutes and then destroy it
@budtmo commented on GitHub (Jul 5, 2018):
Hi @Kurisutian @JoeSSS ,
I assume the topic that you guys discussed is not related with proxy, isnt it? It would be great if you open new issue for it, give some description and work around. To be honest I do not experience it because I do run many containers for now. :(
@Kurisutian commented on GitHub (Jul 6, 2018):
I opened a new issue for that at https://github.com/butomo1989/docker-android/issues/86
@budtmo commented on GitHub (Jul 6, 2018):
For this issue, it is possible by passing flag -http-proxy
@Kurisutian commented on GitHub (Jul 6, 2018):
Where would the be passed exactly?
@budtmo commented on GitHub (Jul 6, 2018):
@Kurisutian it should be pass in the line. Could you help me to solve this issue? we can do something like: we activate that proxy flag automatically if the http_proxy is set in environment variable.
@Kurisutian commented on GitHub (Jul 6, 2018):
This would actually be the expected behavior. If I explicitly set the http(s) and noproxy variables in the environment, it is because everything in the container needs to respect that. Right now if I enter a console from the UI in that the proxy will be used but in the emulator it's not. This inconsistency does not make much sense, since I wanted to use the proxy by setting it as an environment variable anyway.
So yes, I think this would be by far the better behavior to have the emulator use the proxy that has been set as an variable in the environment to remain this kind of consistency.
@Kurisutian commented on GitHub (Jul 11, 2018):
@butomo1989
What can I do to help exactly? Your suggestion to activate the proxy flag automatically seems like what should be used. Especially when we start up 40+ containers for parallel testing, setting the proxy manually is not an option. ;)
@budtmo commented on GitHub (Jul 11, 2018):
It would be great if you can help to fix it and create a PR, because I am working on something else currently @Kurisutian
@mgrazioli commented on GitHub (Aug 6, 2018):
Hi,
I have also the same problem for setting up the proxy automatically when the emulator starts. I have tried to set http_proxy & https_proxy env inside docker container but i didn't have nothing results: Emulator doesn't take this setup.
I have also tried to set up manualy the proxy but I have noticed that only proxy with authentication work correctly.
Have you some idea for solving this big issue. Please help me.
I need to set up my proxy in automatic mode without authentication.
Thanks
Marco
@budtmo commented on GitHub (Aug 8, 2018):
have you tried -http-proxy while running emulator command? @mgrazioli
@mgrazioli commented on GitHub (Aug 8, 2018):
Hi Budi,
where do I put this command? I can not find file where is run emulator command
Thanks
Marco
@budtmo commented on GitHub (Aug 8, 2018):
@mgrazioli https://github.com/butomo1989/docker-android/blob/master/src/app.py#L214 could you create PR if it work.
@mgrazioli commented on GitHub (Aug 8, 2018):
Thankyou very much. I will try :-)
@mgrazioli commented on GitHub (Aug 8, 2018):
Hi Budi,
when I insert -http-proxy in the command emulator, this doesn't run anymore. :-(
@mgrazioli commented on GitHub (Aug 8, 2018):
Hi Budi,
now emulator run, but -http-proxy option seems does not work correctly
@pawelus commented on GitHub (Aug 31, 2018):
@butomo1989 I tried to add the proxy setting in app.py but then emulator wouldn't start properly. It might be because I had to modify Emulator_x86 file to support building the image on a machine with proxy set (e.g. to download needed dependencies over proxy).
Is there some better way to build the image on a machine with proxy (e.g. by passing proxy as a build argument)?
@eyal919 commented on GitHub (Mar 11, 2019):
anyone? any solutions for the proxy?
@kbalakumar99 commented on GitHub (Mar 21, 2019):
If emulator is launched using appium driver. Use avdArgs capability
capabilities.setCapability(AndroidMobileCapabilityType.AVD_ARGS, "-no-boot-anim -no-window -no-audio -http-proxy your-proxy-ip:3128");
p.s don't add http:// before your ip
Same case if launched manually,
emulator -avd emulator_name -no-boot-anim -no-window -no-audio -http-proxy your-proxy-ip:3128
@budtmo commented on GitHub (Mar 21, 2019):
you need to do 2 things:
@kbalakumar99 do you want to be part of this project as contributor by updating the document? it would be great
@kbalakumar99 commented on GitHub (Mar 21, 2019):
@budtmo Thanks for your Invite. Yes, I am willing to contribute.
@HasBert commented on GitHub (May 7, 2019):
Hey guys,
in my setup I'm using the emulator to spy apps with mitmproxy, which is in the same docker network as the emulator is.
I've read on the official mitmproxy site, that some android apps can bypass the http-proxy. I found this post from 2014! and I'm wondering if this issue also applies to the emulator, if I start it with
EMULATOR_ARGS="-http-proxy 172.17.0.2:8080". So far it's working for me, I have no problems to spy on apps. Anyways I question myself:EMULATOR_ARGS="-http-proxy 172.17.0.2:8080"attached globally or is there a way for apps to bypass?The next question has more to do with basic understanding and the asked question above.
@budtmo You said we need to do 2 things to get the proxy to work. Apply the proxy to the container itself and second to the emulator as I did it.
By attaching to the container you meant this? By attaching to the emulator, you meant to attach it to the bridge network gateway ip address? So in my case
172.17.0.1:8080?If I run the emulator in a separate docker
bridgenetwork (docker network create some-network), the official documentation says that this network is isolated to the outside world, so why can I browse websites with the emulator? Is it because of the--privilegedoption which gives the emulator the rights to communicate to the outside world?Thank you for your time ;-) great work so far :-*
@budtmo commented on GitHub (Jul 5, 2019):
It should be fixed on the 1.8-p4. Please feel free to reopen the issue.