I am looking for a way to easily test the mobile version of my site in development.
I have set up IIS Express, such that I can access locally using:
http://localhost:1025/AppName/
or by using my PC name (dazbradbury-pc)
http://dazbradbury-pc/AppName/
This then works from any machine on my network.
However, when I try to use this address from an android device, it simply doesn't work. Has anyone got this working? If so, what further steps were required?
IIS Express Run From a Remote Machineconfig by going to IISExpress\config in your documents folder. Right click the devenv.exe icon and choose properties. Then select the compatibility tab. You can also choose to change this setting for all users if you wish.
On your mobile device's browser (any will work), navigate to http://<Local IP Address>:<port number> . For example, if I was serving on localhost:8080 and my local IP address is 123.45. 67.890, on my mobile device's browser I would navigate to http://123.45.67.890:8080 .
Opening IIS Express in WindowsRun the command box as an administrator as it needs access to configuration files. Change to the website directory (here using cd \website ). In the command box type runphp . The command file will configure IIS Express to use the website directory as a website.
You can access your host machine with the IP address "10.0. 2.2". This has been designed in this way by the Android team. So your webserver can perfectly run at localhost and from your Android app you can access it via "http://10.0.2.2:8080".
Thanks to @SLaks for the information:
That's probably because Android doesn't do WINS name resolution. Try the IP address.
Hence, I updated my IIS Express to point to an IP address by inserting into the bindings in applicationhost.config
an IP address:
<binding protocol="http" bindingInformation="*:80:192.168.1.97" />
where 192.168.1.97
is the local IP address of my machine.
I can now access my machines IIS Express instance from my android device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With