56

Problem Description

I need to configure the proxy manually in my emulator through Android Studio. From the official Android documentation, it is suggested that this change can be made in the "settings" tab of the emulator's extended controls. The problem is that it seems to me that this documentation is outdated, as this setting is no longer displayed in the "settings" tab of the Android Studio emulators' extended controls.

Documentation

with proxy

My Android Studio

without proxy

My version of Android Studio

Android Studio Bumblebee | 2021.1.1 Build #AI-211.7628.21.2111.8092744, built on January 19, 2022 Runtime version: 11.0.11+9-b60-7590822 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 8 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: com.wakatime.intellij.plugin (13.1.10), wu.seal.tool.jsontokotlin (3.7.2), org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40), com.developerphil.adbidea (1.6.4), org.jetbrains.compose.desktop.ide (1.0.0), ru.adelf.idea.dotenv (2021.2), org.intellij.plugins.markdown (211.7142.37) 

4 Answers 4

57

You can open old emulator version by unchecking setting hereenter image description here

If you struggle to close your old emulator, try killing qemu... process

Sign up to request clarification or add additional context in comments.

2 Comments

2 years later, it is still the correct approach to do this.
3 years later still relevant
14

You can go to setup proxy in Android Studio itself.

  1. Configure Proxy in the Preferences window Preferences window
    1. Go to Preferences window (Mac: cmd+, shortcut).
    2. Click Appearance & Behavior on the left panel
    3. Click System Settings on the left panel
    4. Click HTTTP Proxy on the left panel
    5. Setup your preferred proxy settings
    6. Confirm by clicking OK
  2. You need to restart emulator to apply your changes

The downside of the solution is that the proxy is also applied to Android Studio itself. So traffic from Android Studio goes through the proxy.

1 Comment

The settings from Android Studio are not used in the emulator - at least not on my machine. Settings in AS are working perfectly fine, still the Android Emulator has no Internet access. Strange.
5

After a while trying to find solutions to this problem, I saw that an emulator running outside android studio provides these options. To run a standalone Android Studio emulator see the official documentation or simply enter the command:

emulator -avd <avd_name> 

In my case I'm using an avd named PIXEL 4 API 30, so the command will be emulator -avd PIXEL_4_API_30. If you are on Windows you may have problems running this command so I suggest you see this.

Edit

The solution proposed by @Inliner also solves this problem.

1 Comment

this should be the accepted anwser!
2

You can add the proxy in the emulator wifi settings. Click on internet settings, select androidWifi. Click on the edit icon then add your proxy there.

Android wifi settings

Edit network settings

Proxy setup

2 Comments

Do you know what's the difference? My Charles only works when I set up a proxy in WiFi settings, not in the emulator settings.
I'm not sure, however I had a similar experience to @Zordid where my emulator isn't using the same settings as my IDE

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.