Search code examples
ioscameraios-simulatorsimulatorhosts

IOS test website that requires to change hosts file and to use camera


my situation

I have a staging website running, that requires me to change my hosts file to access it.
I made some changes to the website, and want to test if the website works on different browsers and different devices.
I am currently trying to test the website for Safari on an iPad or iPhone.

what I tried

I tried using Xcode Simulator to test this, but found out that Xcode Simulator cannot access camera functionalities, and I couldn't find a workaround.
I decided test my website on an iPad, but found out that you cannot change the hosts file without jailbreaking, which is out of the question.
(changing the hosts file is not required on the simulator as it just copies the mac's settings)

question

Is there any way for me to test if my website is working correctly?
Should I approach it from the simulator or from the iPad device hosts file?


Solution

  • Apparently, you can use mobile hotspots for this.
    If you have a Windows device you can change your hosts file, turn on your mobile hotspot, connect to it with your IOS device and the websites will change according to your hosts file.
    Alternatively, you can simply use the default clock video that xcode adds to your simulator, but I wouldn't rely on it for a final test run.