How to easily test your local website or PWA on your phone
You might not know it, but you can host a website on your local network with just a single command! This trick works on macOS, but I’m not sure about other operating systems.
- Open Terminal and navigate to the directory of your app
php -S 0.0.0.0:8000(or whatever port you want)
- Find your private IP address in System Preferences > Network
- Make sure your phone and computer are on the same WiFi network
<IP ADDRESS>:8000on your phone