Manually Setting Host File on iPhone/iPad

Setting up the HOST file on a mobile device

 

Sometimes the QA team would be in need to test websites by pointing the URL to a particular IP or a server. I guess some of you would have come across this situation in your testing career. This typically happens when you need to test a high traffic website in which the load has been shared between servers. This can be done easily when we need to test the website on computer. Setting up the Host file is enough to do this. However, I came across a situation where I need to test the mobile version of a website for which I need to point the URL to a specific IP.



In this article I’m going to explain how this could be done on Mobile device in the easiest way. I am going to explain how to do this on a iOS device.


Step 1:

Most of the testers would use the Fiddler tool, so let’s use the same tool to which is readily available with us (If not available, please install on your computer. It’s a free tool available on the internet).


Step 2:


Make a note of the IP address of the computer in which Fiddler is available.


Step 3:

Tap on the Setting icon on the iOS device and click on the WiFi Setting. On the next screen tap on the blue navigation arrow on the connected WiFi as shown in the figure below.

  

Setting up Proxy On iPhone

Step 4:

Scroll down to the bottom of the page on the iPhone and tap on the ‘Manual’ tab under the HTTP proxy and enter the IP address of the computer which you noted on Step 2 as the Server IP. Set the port number as 8888. That’s all the proxy has been configured on the computer.

Proxy on iPhone


Step 5:

Open the Fiddler tool and click on the ‘Fiddler options’ under ‘Tools’. The fiddler options pop-up would open up and in the pop-up click on the ‘Connections’ tab. Enable the ‘Allow remote computers to connect’ and click ‘Ok’ button.

Allow to connect to remote computer

  

Step 6:

This is the important step to set up the host file. Click on the ‘HOST’ under ‘Tools’ menu. This will open the Host remapping pop-up. Enable the check box in the pop-up, enter the IP address of the server to which you want to point when a request is made to hit the URL. Followed by the URL and click on the ‘Save’ button. Example: When you want to point 192.168.1.10 when there is a request to hit URL: mytestingwebsite.com you may enter as below:

192.168.1.10 mytestingwebsite.com

Please refer the below screen shot to get the idea of it.

Editing the HOST file for remote computer

Step 7:

The stage is set. You can just start testing the website on the iPhone or iPad, which will point the requests of the URL to the preset IP address.