DEV Community 👩‍💻👨‍💻


Posted on

How to check the operation of Gatsby on a smartphone or other device that is under development in a local network

First things first

I'll show you how to check the Gatsby site that is under development on an actual smartphone or other device.


gatsby: 2.19.2

The IP address of the development machine may be different for each OS because it has been tested on mac.

Get the IP address of the development machine

Get an IP address by ifconfig command

> ifconfig
    ether xx:xx:xx:xx:xx:xx
    inet6 fe80::18e8:b8eb:c36b:8185%en0 prefixlen 64 secured scopeid 0x6
    inet netmask 0xffffff00 broadcast
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
... ...

The above shows that the IP address in the LAN is

Add the -H option to Gatsby's development mode

Add to the host's options

Defaults to localhost  -H, --host  Set host.


> gatsby develop -H

Accessing Gatsby's development mode from your smartphone

After confirming that it is running on localhost:8000, you can use a browser on a smartphone connected to Wifi in the LAN to
Based on the IP address acquired earlier, you can access the terminal where the development mode of Gatsby is running on the default 8000 port.

Oldest comments (0)

🌚 Life is too short to browse without dark mode