Testing Locally Hosted Site on Phone

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.

Resources

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s