Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Post Timeline

added automated instructions
Source Link
alecdwm
  • 981
  • 12
  • 16

I found a workaround in this GitHub discussion, which works for both Codespaces and Dev Containers:

  1. Start expo with expo start
  2. Connect to the expo dev server with your simulator / physical device
  3. 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)
  4. Take note of the device and page query parameters in webSocketDebuggerUrl
    e.g. for the url ws://example.orb.local/inspector/debug?device=12345678&page=1, device is 12345678 and page is 1
  5. 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:

  1. Start expo with expo start
  2. Connect to the expo dev server with your simulator / physical device
  3. 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)
  4. Take note of the device and page query parameters in webSocketDebuggerUrl
    e.g. for the url ws://example.orb.local/inspector/debug?device=12345678&page=1, device is 12345678 and page is 1
  5. 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:

  1. Start expo with expo start
  2. Connect to the expo dev server with your simulator / physical device
  3. 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)
  4. Take note of the device and page query parameters in webSocketDebuggerUrl
    e.g. for the url ws://example.orb.local/inspector/debug?device=12345678&page=1, device is 12345678 and page is 1
  5. 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"
Source Link
alecdwm
  • 981
  • 12
  • 16

I found a workaround in this GitHub discussion, which works for both Codespaces and Dev Containers:

  1. Start expo with expo start
  2. Connect to the expo dev server with your simulator / physical device
  3. 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)
  4. Take note of the device and page query parameters in webSocketDebuggerUrl
    e.g. for the url ws://example.orb.local/inspector/debug?device=12345678&page=1, device is 12345678 and page is 1
  5. 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.

AltStyle によって変換されたページ (->オリジナル) /