I found a workaround in this GitHub discussion, which works for both Codespaces and Dev Containers:
- Start expo with
expo start - Connect to the expo dev server with your simulator / physical device
- Go to
<your codespace or dev container url>/json
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/json(codespace)
e.g.https://example.orb.local/json(dev container) - Take note of the
deviceandpagequery parameters inwebSocketDebuggerUrl
e.g. for the urlws://example.orb.local/inspector/debug?device=12345678&page=1,deviceis12345678andpageis1 - Open a new tab in Chrome and navigate to this URL:
<your codespace or dev container url>/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D<device>%26page%3D<page>
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D12345678%26page%3D1
Chrome will open the react-native devtools inside of that tab, including support for the Components ⚛ and Profiler ⚛ tabs.
Here's a slightly easier (scripted) approach:
# Enter the URL of your dev server (no trailing `/`)
CODESPACE="http://localhost:8081"
# Gets the `webSocketDebuggerUrl` of the most recently connected device
WS_DEBUGGER_URL="/$(curl -s "$CODESPACE/json" | jq -r '.[-1].webSocketDebuggerUrl' | cut -d'/' -f4-)"
# Urlencodes the url
ENCODED_URL="$(python3 -c "import urllib.parse;print(urllib.parse.quote('$WS_DEBUGGER_URL'))")"
# Prepares the devtools url
DEVTOOLS_URL="$CODESPACE/debugger-frontend/rn_fusebox.html?ws=$ENCODED_URL"
# Opens the devtools url in Chrome
open -a Chrome "$DEVTOOLS_URL"
I found a workaround in this GitHub discussion, which works for both Codespaces and Dev Containers:
- Start expo with
expo start - Connect to the expo dev server with your simulator / physical device
- Go to
<your codespace or dev container url>/json
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/json(codespace)
e.g.https://example.orb.local/json(dev container) - Take note of the
deviceandpagequery parameters inwebSocketDebuggerUrl
e.g. for the urlws://example.orb.local/inspector/debug?device=12345678&page=1,deviceis12345678andpageis1 - Open a new tab in Chrome and navigate to this URL:
<your codespace or dev container url>/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D<device>%26page%3D<page>
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D12345678%26page%3D1
Chrome will open the react-native devtools inside of that tab, including support for the Components ⚛ and Profiler ⚛ tabs.
I found a workaround in this GitHub discussion, which works for both Codespaces and Dev Containers:
- Start expo with
expo start - Connect to the expo dev server with your simulator / physical device
- Go to
<your codespace or dev container url>/json
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/json(codespace)
e.g.https://example.orb.local/json(dev container) - Take note of the
deviceandpagequery parameters inwebSocketDebuggerUrl
e.g. for the urlws://example.orb.local/inspector/debug?device=12345678&page=1,deviceis12345678andpageis1 - Open a new tab in Chrome and navigate to this URL:
<your codespace or dev container url>/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D<device>%26page%3D<page>
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D12345678%26page%3D1
Chrome will open the react-native devtools inside of that tab, including support for the Components ⚛ and Profiler ⚛ tabs.
Here's a slightly easier (scripted) approach:
# Enter the URL of your dev server (no trailing `/`)
CODESPACE="http://localhost:8081"
# Gets the `webSocketDebuggerUrl` of the most recently connected device
WS_DEBUGGER_URL="/$(curl -s "$CODESPACE/json" | jq -r '.[-1].webSocketDebuggerUrl' | cut -d'/' -f4-)"
# Urlencodes the url
ENCODED_URL="$(python3 -c "import urllib.parse;print(urllib.parse.quote('$WS_DEBUGGER_URL'))")"
# Prepares the devtools url
DEVTOOLS_URL="$CODESPACE/debugger-frontend/rn_fusebox.html?ws=$ENCODED_URL"
# Opens the devtools url in Chrome
open -a Chrome "$DEVTOOLS_URL"
I found a workaround in this GitHub discussion, which works for both Codespaces and Dev Containers:
- Start expo with
expo start - Connect to the expo dev server with your simulator / physical device
- Go to
<your codespace or dev container url>/json
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/json(codespace)
e.g.https://example.orb.local/json(dev container) - Take note of the
deviceandpagequery parameters inwebSocketDebuggerUrl
e.g. for the urlws://example.orb.local/inspector/debug?device=12345678&page=1,deviceis12345678andpageis1 - Open a new tab in Chrome and navigate to this URL:
<your codespace or dev container url>/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D<device>%26page%3D<page>
e.g.https://obscure-space-engine-grx7rgg6qp43v9j5.github.dev:8081/debugger-frontend/rn_fusebox.html?ws=%2Finspector%2Fdebug%3Fdevice%3D12345678%26page%3D1
Chrome will open the react-native devtools inside of that tab, including support for the Components ⚛ and Profiler ⚛ tabs.