Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

react-native-debugger-open NPM version

Replace open debugger-ui with Chrome to open React Native Debugger from react-native packager

[macOS] If you opened the app before (registered URI scheme), you can use this patch open the app automatically. [Linux / Windows] Currently it cannot open the app automatically, it just send set-debugger-loc request, so you need open the app yourself.

Screenshot

demo

Installation

First, install React Native Debugger.

In your React Native project:

$ npm i --save-dev react-native-debugger-open # or -g

Usage

Inject to react-natvie packager

Add command to your project's package.json:

"scripts": {
  "postinstall": "rndebugger-open"
}

It will be run after npm install. (You can run npm run postinstall first) The ./node_modules/react-native/local-cli/server/middleware/getDevToolsMiddleware.js code will be replaced.

Use REACT_DEBUGGER env of react-native packager

Instead of Inject to react-natvie packager, you can just do:

$ REACT_DEBUGGER="rndebugger-open --open --port 8081" npm start

# Windows
$ set REACT_DEBUGGER="rndebugger-open --open --port 8081" && npm start

Options (--option)

Name Description
macos Use react-native-macos module name instead of react-native. Default is false
revert Revert rndebugger-open injection. Default is false
open Run open directly instead of inject patch
port Specified react-native packager port with --open option. Default is 8081
expo Use Expo specified RN packager default port if you're not specified port.

You can also use following commands instead of this patch:

# macOS
$ open "rndebugger://set-debugger-loc?port=8082"

# macOS with `REACT_DEBUGGER` env
$ REACT_DEBUGGER="open -g 'rndebugger://set-debugger-loc?port=8082' ||" npm start
# If you're use Expo
$ REACT_DEBUGGER="unset ELECTRON_RUN_AS_NODE && open -g 'rndebugger://set-debugger-loc?port=8082' ||" npm start

LICENSE

MIT