I’ve been building a Rails app with mobile, tablet, and desktop views using Materialize CSS and wanted to be able to test the site on my Android phone to make sure sizing and touchscreen links are user-friendly.
Localhost.run turned out to be a quick solution. After running an app on port 8080, you can run Localhost’s command and get a url to view the site from another device for preview and testing.
For a Rails app, start the server on port 8080.
rails s -p 8080
Then, run Localhosts’ command in another Terminal window.
ssh -R 80:localhost:8080 -p 2222 ssh.localhost.run
LocalHost will print the url to visit in Terminal.