Catalogue
Configuring Android Studio AVD (Emulator) to Connect to the Desktop's localhost

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.

kenzo0107

kenzo0107