Injecting remotedev-app monitor into official Remote debugger of React Native
npm install remotedev-rn-debugger



!Demo
Injecting remotedev-app monitor into official Remote debugger of React Native. (formerly remote-redux-devtools-on-debugger)
We can use it with:
- remote-redux-devtools
- remotedev
- mobx-remotedev
__NOTE__ We will stop publish the old name remote-redux-devtools-on-debugger on next major version v0.9.
``bash`
$ npm install --save-dev remotedev-rn-debugger
Add command to your project's package.json:
``
"scripts": {
"postinstall": "remotedev-debugger [options]"
}
It will be run after npm install. (You can run npm run postinstall first) ./node_modules/react-native/local-cli/server/util/debugger.html
The will be replaced.
#### Options (--option)
Name | Description
--- | ---
hostname | The remotedev-server hostname. (default: localhost if port is set)8000
port | The remotedev-server port. (default: if runserver or hostname is set)hostname
runserver | Start the remotedev-server with , port option on local. (default: false)hostname
secure | Use https protocol for . If you're use runserver or injectserver option, you can provide key, cert, passphrase options for remotedev-server. (default: false)hostname
injectserver | Inject remotedev-server with , port option to node_modules/react-native/local-cli/server/server.js, then you can start ReactNative local server and RemoteDev local server with one command ($ npm start). (default: false)hostname
injectdebugger | Inject remotedev-app with , port option to node_modules/react-native/local-cli/server/util/debugger.html. (default: true)false
macos | Use react-native-macos module name instead of react-native. (default: )false
revert | Revert all injection. (default: )ws
wsengine | The web socket engine used in remotedev-server: or uws. If not set, remotedev-server default value is used. (default: undefined)
If you not set hostname or port or runserver or injectserver, it will apply default options.
You can ignore this guide if you used default options.
#### Install dev dependencies
`bash`
$ npm install --save-dev remote-redux-devtools
$ npm install --save-dev remotedev-rn-debugger
#### Add command
Add command to your project's package.json:
``
"scripts": {
"postinstall": "remotedev-debugger --hostname localhost --port 5678 --injectserver"
}
It will be run after npm install. (You can run npm run postinstall first) hostname
If you debug on real device, you should use LAN IP as a .
#### Edit configureStore.js
`js
import { Platform } from 'react-native';
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import devTools from 'remote-redux-devtools';
import reducer from '../reducers';
export default function configureStore(initialState) {
const enhancer = compose(
applyMiddleware(thunk),
devTools({
name: Platform.OS,
hostname: 'localhost',
port: 5678
})
);
return createStore(reducer, initialState, enhancer);
}
``
You can reference this example.