After some trial and error, I came to the conclusion that the built-in Mobile Emulation in Chrome is the best way to quickly preview Discourse pages on a mobile device.
Sure you can also just append
?mobile_view=1 to an URL, but the emulator has the added benefit of letting you select the screen profile of a specific device.
Edit: I asked Screenfly why Discourse wasn’t working, this is their reply:
Screenfly doesn’t work on every website. Most commonly, this is a security setting on the web server that disallows display inside of frames (like those used in Screenfly).
Yes, here’s how to do it in Chrome.
(optional) Enter incognito mode so you don’t conflict with your existing browser instance cookies, etc.
Press f12 to show developer mode.
Press the “Show Drawer” icon
In the expanded drawer, select the Emulation tab.
Select the device you wish to emulate from the drop down list. I recommend Google Nexus 5/7 and Apple iPhone 5 as typical these days, at least for what we’re doing on Discourse. Bear in mind that Google Chrome is Blink so it is spiritually closest to Android Chrome at this point, if you want the most “realistic” emulated mobile device, that is it.
Press the Emulate button.
Make sure to turn off “touch” in the Sensors, otherwise mousing is a pain.
Refresh the page via f5 or the refresh button.
Collapse the expanded drawer by clicking the drawer icon again.
Now you’re using a “mobile device”, right in your regular desktop browser.
Just close the browser when you’re done.
This process changed a bit in the latest Chrome – the mobile emulation is much more sophisticated now:
- you can specify simulated network delays
- you can show media queries by width to identify which CSS (by width) is specifying the current layout
- there’s a nice black grid background for visualizing layout sizes
But the basic process is the same, F12 to launch developer tools, then emulation.