

If you are using localhost for debugging and it isn't working, close the app and open it up again using Open on Android.

When you run a project on your device with npx expo start or npx expo run:android, the Expo CLI automatically tells your device to forward localhost:19000 to your development machine, as long as your device is plugged in or emulator is running. To get correct line numbers open up the Chrome Dev Tools settings, go to the "Blackboxing" tab, make sure that "Blackbox content scripts" is checked, and add expo/build/logs/RemoteConsole.js as a pattern with "Blackbox" selected. Line numbers for console.log statements don't work by default when using Chrome debugging. Shake the device and stop Chrome debugging when you're done. This should open up a Chrome tab with the URL From there, you can set breakpoints and interact through the JavaScript console. Open the app on your device, reveal the developer menu then tap on Debug JS Remotely. npx expo start -localhost will not work for iOS unless you are in the simulator, and it only works on Android if your device is connected to your machine via USB. This may not work on some public networks. If you are using npx expo start -lan, make sure your device is on the same Wi-Fi network as your development machine. If you use npx expo start -tunnel with debugging enabled, you are likely to experience so much latency that your app is unusable. To ensure the best debugging experience, first, change your host type to npx expo start -lan or npx expo start -localhost.

You can then set breakpoints, inspect variables, execute code, etc., as you would when debugging a web app. Rather than running your app's JavaScript on your phone, it will instead run it inside of a webworker in Chrome. You can debug React Native apps using the Chrome debugger tools. If you have any questions on setting that up, give the next section a look! Remote debugging with Chrome Developer Tools React DevTools can also be paired with remote debugging, allowing you to inspect props, state, and instance properties in the Chrome console.
