Previewing in Xcode Simulator

@Photics got me thinking about using the simulator to look at hype exports, when you do not have a particular device.

He mentioned doing it here.
But the normal way is to include the exported hype project in an Xcode app build. The run the App in the simulator.

Which could be a pain if you are not actually building an App but know that you will be running it via a particular device.

It turns out all you need to do is Preview in the normal way on a Mac browser.
Copy the url.

For example:

"127.0.0.1:56039/preview/CE58484E-3A70-4DC6-9AA8-10311ADCFD70-44814-000011318601A846/index.html"

Open a simulator device. via the Simulator.app
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

Open its Mobile Safari,
And paste the url in the address bar and go to it.

Now just before I was about to post this how to tip but thought I better search instead to see if this is known.

It seems that people have wanted to do this in the past but the Simulator did not allow it. @jonathan mentions it here.

I am pretty sure I have no special setup so this should work for you in at least Simulator Version 12.3 (940.20) ( Catalina )
And it even works with a localhost:8000/xcard2020.html url if you are running a simpleServer via terminal.app.

4 Likes