I use Android Studio 2.1.3.
When I run an Android app I pick an AVD, where can I pass command line options such as -http-proxy
? I don't even find a way in the run configuration.

- 35,772
- 9
- 166
- 188

- 4,068
- 8
- 40
- 60
-
I think this will answer your question: http://stackoverflow.com/questions/1570627/how-to-setup-android-emulator-proxy-settings If it doesn't, please clarify what you want to do. – Ravenix Sep 08 '16 at 17:37
-
4I don't know how I could be more clear ;-) If I wanted to run the emulator in the command line I would do `emulator -avd name -http-proxy localhost:8888` but I don't use the command line, I click on the run button in Android Studio so I want to set the options somewhere in the IDE. – Maxime Laval Sep 08 '16 at 17:44
-
You can start the AVD first with command line. Then, when you click play, you can select which device to use. You can select the running AVD you've started with your command line, this should work. I don't think it's possible to do it otherwise with the settings in the AVD itself. – Ravenix Sep 08 '16 at 17:52
-
I'd try at least this http://stackoverflow.com/a/32629260/2442831 – Lino Sep 08 '16 at 19:11
-
I did some research on this and someone correct if I'm wrong but I think you used to be able to do this easily in Android Studio but they removed the option. Why they removed it and how to do it now I'd like to know as well. – ShadowGod Sep 08 '16 at 19:14
-
1Ravenix, it takes forever to launch when I use the command line... ShadowGod apparently you are right: http://stackoverflow.com/questions/34644264/where-are-the-additional-command-line-options-in-android-studio-version-1-5-1-fo – Maxime Laval Sep 12 '16 at 19:58
3 Answers
I found a hacky solution to add parameters to the Android Studio AVD.
Android Studio by default uses the binary $ANDROID_SDK/emulator/emulator
. In my case the path in MacOS is /Users/martin/Library/Android/sdk/emulator/emulator
. What I did is:
Rename the binary to
emulator-original
Create a bash script with the name
emulator
that contains:/Users/<YOUR_USERNAME>/Library/Android/sdk/emulator/emulator-original <PARAMS> $@```
Change the script permissions with
chmod +x emulator
Now Android Studio runs my script instead of running the binary
Update: try Stef's solution first, it looks better than this hack

- 658
- 6
- 7
-
2
-
2In my case I had to disable the audio of the emulator because it was stopping the audio channel of my Mac. So, in my case I had to add the parameters at the end like this: #!/bin/bash ~/Library/Android/sdk/emulator/emulator-original $@ -qemu -no-audio Thank you, @MartinCR! – Ivo Stoyanov Apr 07 '21 at 12:30
-
1nice hack. but proper solution would be setting the env variable as pointed out in Stef's answer. – Elangovan Manickam Sep 02 '21 at 22:28
You can set emulator start parameters in an environment variable studio.emu.params
; they will be added to the command line when AS starts the emulator, see source code.
Tested on Windows with AS 4.1 and set studio.emu.params=-writable-system
.

- 28,728
- 2
- 24
- 52
-
Great. It worked for me! A note: you should restart your android studio after changing the enviroment variable to take it effect. – progquester Dec 17 '20 at 02:54
-
I was breaking my head searching this. glad found this post. I added this to my windows environment variable and restarted the Android studio, and ran AVD inside android studio. It used the env variable to launch the emulator. now I'm able to do remount. thanks a lot! – Elangovan Manickam Sep 02 '21 at 22:27
-
1Worked for me too, although I had to check the source code reference to work out that you need to separate arguments and their options using commas rather than spaces, e.g. `set studio.emu.params=-gpu,angle_indirect` is equivalent to command line `emulator -gpu angle_indirect` – AGDownie Oct 03 '21 at 23:26
I'm also missing those settings.. Some kind of workaround is to go to wifi settings -> tap and hold wifi network -> modify network and there update proxy/dns settings

- 1,094
- 1
- 12
- 14