Hi friends of Support at Flywheel!
After a lot of work, and searching, I finally figured out how to connect my Android Emulator to my Wordpress site on Local at Flywheel…
So, I thought I’d share it with you, because there is very little information out there, and it is something that can come in very handy.
I am on a mac, so the instructions here are for the mac, even though I know it can be done on Windows or Ubuntu.
1 - In Android Studio, go to Tools/AVD Manager.
2 - Extend the list that comes up, so you can see what is in the “Target” column
3 - Choose the most recent AVD possible, and make sure the Target column says: (Google APIs) and not (Google Play).
If you don’t have any Google API targets, you can download them through the SDK Manager, SDK Tools tab, and make sure the following boxes are checked:
4 - Then, from a terminal shell, make sure that adb is in your path. It is in Users//platform-tools (on Mac).
5 - Then, locate the Android SDK tools /Users//Library/Android/sdk/tools (also on Mac)
6 - Find out the official name of the emulator you have chosen by calling:
/Users//Library/Android/sdk/tools/emulator -list-avds
7 - Launch the emulator from a terminal shell, with writable system:
/Users//Library/Android/sdk/tools/emulator -avd Nexus_S_API_25 -writable-system -memory 1024
The avd name is for example.
8 - The emulator should launch. If you get a black screen, go back to the AVD manage, press on the down arrow next to the edit pencil, and choose “Wipe Data”. Then quit the emulator, and try again.
9 - Once the emulator is running, you will need to open another terminal shell, as the emulator call does not return until you quit.
10 - From that new shell, find out the name of your current emulator instance, by calling $ adb devices
The number will usually be emulator-5554
11 - Get the “hosts” file: $ adb pull /system/etc/hosts hosts_new // This will copy the hosts file to the directory you are calling from
12 - Edit the “hosts_new” file: