Configuring Android Studio AVD (Emulator) to Connect to the Desktop's localhost
Overview
I’m developing an Android app with Android Studio on Mac OS X.
I’m using Volley from an AVD (Android Virtual Device) to hook up the API to a server built in a local environment such as MAMP, Vagrant, or Docker.
Simply opening the web browser (the globe icon) on the emulator and specifying localhost won’t let you connect.
That required a little extra step, so here is the procedure.
Configuration
- While the AVD is running in Android Studio, run the following shell command.
That’s all.

