DEV Community

Cover image for Configure Android emulator to access web app hosted on local machine
Jamael Tanveer Nayon
Jamael Tanveer Nayon

Posted on

Configure Android emulator to access web app hosted on local machine

If you want to access a web application hosted on your local machine hosted with xampp or mamp configured with custom local domain using virtualhost from an Android emulator, do the following:

  1. Create AVD with Google APIs image (not Google Play image)
  2. Execute the following commands:
adb root
adb remount
adb pull /system/etc/hosts .
nano hosts
  1. Add your required entries like the following:
127.0.0.1       localhost
::1             ip6-localhost
10.0.2.2        your.custom.domain
  1. After that Execute the following commands
adb push hosts /system/etc/hosts
adb reboot

Top comments (1)

Collapse
 
neoacevedo profile image
neoacevedo • Edited

adb remount
remount of the / superblock failed: Permission denied