Lädt...


🔧 Dev Tip: How to view Dev Tip: How to view localhost web apps on your phone


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

I’m always building web application products that need to be optimized for mobile. Viewing my project on a phone before deploying is a must.

I often use the mobile device emulator in Chrome Devtools for little style adjustments, but there’s nothing that will perfectly emulate an actual mobile browser better than the mobile device itself. This helps me catch mobile-specific bugs before they surface as a problem for users.

Here’s a method I use to make testing on mobile devices extremely easy. These instructions are for a Mac environment.

Serve over your wifi via local IP
This sounds complicated but its actually really easy.

IMPORTANT: Make sure that your dev computer and your mobile device are connected to the same wifi network.

Step 1: Serve to Localhost
On your dev machine, serve your application in whatever way you usually do that serves it over a localhost address.

Make sure to note what port number its being served on. In the image below, we’re noting 8080.

Once you are able to view your app locally on your computer via localhost, you can move to step 2.

Step 2: Find your Local IP Address
Open System Preferences > Network. Select “Wifi” in the left pane if it isn’t already selected.

Image description

Under “Status: Connected”, you should see “Wi-Fi is connected to and has the IP address .”

Take note of that IP address!

Note: It’s common for your Local IP Address to change automatically when your device or other devices connect/disconnect from the network. So you can’t really bookmark this address. Instead, you’ll have to find your address each time — for me, this is usually just when I get started each morning and it stays throughout the day.

Step 3: View on your phone
On your mobile device’s browser (any will work), navigate to http://:.

For example, if I was serving on localhost:8080 and my local IP address is 123.45.67.890, on my mobile device’s browser I would navigate to http://123.45.67.890:8080 . The http:// is important, don’t leave it off.

Success!
You should now be viewing your app on your mobile device. Set it up right next to your main monitor, because it will reload every time your localhost reloads, so it will be perfectly in sync with the locally served desktop web application.

You don’t get any front-end devtools with this experience, but you do get an early warning if things look or behave differently on a native browser’s experience.

...

🔧 Dev Tip: How to view Dev Tip: How to view localhost web apps on your phone


📈 76.66 Punkte
🔧 Programmierung

📰 IETF Working to Standardize "Localhost" as True "Localhost"


📈 36.09 Punkte
📰 IT Security

📰 IETF Working to Standardize "Localhost" as True "Localhost"


📈 36.09 Punkte
📰 IT Security

🔧 Two ways to access localhost on your phone ✌️


📈 26.27 Punkte
🔧 Programmierung

🔧 Change your Sveltekit (or any vite-powered) dev server localhost port


📈 25.86 Punkte
🔧 Programmierung

⚠️ VB2021 localhost is over, but the content is still available to view!


📈 24.55 Punkte
⚠️ Malware / Trojaner / Viren

⚠️ VB2020 localhost is over, but the content is still available to view!


📈 24.55 Punkte
⚠️ Malware / Trojaner / Viren

🔧 How to View Your Local Dev Server on Your Phone (VsCode Live Server, Next.js, React/Vite)


📈 22.54 Punkte
🔧 Programmierung

🪟 Microsoft Your Phone "replaces" Windows phone and may "replace" your phone


📈 21.92 Punkte
🪟 Windows Tipps

📰 WSL2 Now Supports Localhost Connections From Windows 10 Apps


📈 21.68 Punkte
📰 IT Security Nachrichten

🔧 From Localhost to the Cloud: A Guide to deploy Flask web application on AWS EC2


📈 21.34 Punkte
🔧 Programmierung

🐧 KDE Tip: Suspend your computer from your phone


📈 21.11 Punkte
🐧 Linux Tipps

🔧 Expose Your Localhost to a Public URL


📈 20.79 Punkte
🔧 Programmierung

🔧 From LocalHost to Public Endpoint - Quickly Share Your Work With zrok


📈 20.79 Punkte
🔧 Programmierung

🔧 How to Access Your Localhost API from Docker Containers


📈 20.79 Punkte
🔧 Programmierung

🔧 Must-Have Tunneling Tools for Developers: Effortlessly Expose Your Localhost in Minutes


📈 20.79 Punkte
🔧 Programmierung

🔧 How to share your "localhost" with the world


📈 20.79 Punkte
🔧 Programmierung

🔧 How to collaborate better with your team on Localhost


📈 20.79 Punkte
🔧 Programmierung

🔧 Virtual Host Setup with SSL Certificate in Your Localhost


📈 20.79 Punkte
🔧 Programmierung

🔧 Sharing Your Localhost with Other Devices Easily


📈 20.79 Punkte
🔧 Programmierung

🎥 Wiko View / View XL und View Prime mit Dual-Frontkamera im ersten Test – Hands-on | IFA


📈 19.52 Punkte
🎥 Videos

📰 Wiko View, View XL & View Prime: Wiko stellt neue Smartphones vor


📈 19.52 Punkte
📰 IT Security Nachrichten

📰 Wiko View, View XL und View Prime im Hands-On: Edle Optik in der Mittelklasse


📈 19.52 Punkte
📰 IT Nachrichten

🎥 When your gaming phone is trying not to be a gaming phone. #shorts #gaming #phone #gamer #android


📈 19.18 Punkte
🎥 Video | Youtube

🪟 Publishing hidden apps (Dev Center Tip #5)


📈 18.86 Punkte
🪟 Windows Tipps

🪟 Publishing hidden apps (Dev Center Tip #5)


📈 18.86 Punkte
🪟 Windows Tipps

📰 A Simple Breakdown of Localhost and 127.0.0.1 in Networking


📈 18.05 Punkte
🐧 Unix Server

matomo