reactotron-react-native: Use in real device

Created on 18 Oct 2016  路  8Comments  路  Source: infinitered/reactotron

How to let it work when use real device?

Most helpful comment

I did this so that I didn't have to configure the ip manually when switching between physical devices and simulators.

import Reactotron from 'reactotron-react-native';
import { NativeModules } from 'react-native';

// grabs the ip address
const host = NativeModules.SourceCode.scriptURL.split('://')[1].split(':')[0];

const reactotron = Reactotron.configure({ host })
  .useReactNative()
  .connect();

export default reactotron;

All 8 comments

+1

I haven't tested this but you can specify a host and port in the configure call. So you would do something like:

Reactotron.configure({ host: '<IP TO YOUR MACHINE>', port: <PORT IF OTHER THEN DEFAULT> }).connect()

Of course you have to ensure that your machine lets traffic in on the port.

It's work, thanks.

I am facing some problem. @rmevans9 do we need to change anything under "Dev Setting" ? and what is the default port ? 9090, 8081 or any other ?

馃憢 Hello @smitthakkar1!

No changes should need to happen. The default port for Reactotron is 9090. If it still doesn't work then I would recommend checking versions for reactotron for both the module (in package.json) and the reactotron app. If that doesn't show the issue please open a new issue as this one is a bit dated.

Worked it. thanks @rmevans9 . appreciate your quick response.

I did this so that I didn't have to configure the ip manually when switching between physical devices and simulators.

import Reactotron from 'reactotron-react-native';
import { NativeModules } from 'react-native';

// grabs the ip address
const host = NativeModules.SourceCode.scriptURL.split('://')[1].split(':')[0];

const reactotron = Reactotron.configure({ host })
  .useReactNative()
  .connect();

export default reactotron;

@ericadamski Thanks for saving my time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skellock picture skellock  路  4Comments

dhruwal picture dhruwal  路  3Comments

AdrienLemaire picture AdrienLemaire  路  3Comments

nonameolsson picture nonameolsson  路  5Comments

sylar picture sylar  路  4Comments