Android Emulator: Connecting to Localhost

I often use the Android Emulator to do testing on a Xamarin Forms app, or Cordova, or something of the sort.
It’s a long round trip to point at test when you want to debug the backend behaviour, so let’s point it at local dev!

The Android Emulator maps to localhost, so can we just do that? In Kestral, yes!
I changed my Xamarin Forms app to point at (my Kestral backend) and it Just Works.

Wonderful, but…what if we’re working with IIS?

IIS = Intrinsically Irritating Server

Here’s the process I found after much Stack overflow (but essentially this one)

EDIT: Sept 2022
This tends to fail to run on PC restart (unable to parse hostname)
Changing back to localhost and running, then stopping and making it * again works…Weird, but fine.

Tags: android