-
Notifications
You must be signed in to change notification settings - Fork 945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use Reactotron with physical iOS device #272
Comments
There isnt port forwarding, but you can use the IP address of your computer. I'll put together some docs. I hear that question a lot. |
Thanks a lot. I really appreciate it! 👍 |
For those looking to do this on iOS, here's how to do it:
|
I use this: import {NativeModules} from 'react-native';
import Reactotron from 'reactotron-react-native';
let scriptHostname;
if (__DEV__) {
const scriptURL = NativeModules.SourceCode.scriptURL;
scriptHostname = scriptURL.split('://')[1].split(':')[0];
}
Reactotron
.configure({host: scriptHostname})
.connect(); |
woah. that's awesome! |
Does anyone try the @mkubliniak solution on Android ? |
@Fenwil I tried using this solution on Android, the result was Reactotron display's connection event, but no other events are displayed. |
It worked for me @antondomratchev my problem was that I was using other ports and not doing port forwarding from the smartphone to reactotron using the reactotron default port 9090. "scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"android": "adb reverse tcp:8888 tcp:8888; adb reverse tcp:9090 tcp:9090; react-native run-android --variant developmentDebug",
"lint-staged": "lint-staged",
"lint": "eslint index.*.js src",
"test": "jest --runInBand",
"test-cov": "jest --runInBand --coverage",
"prettier": "node ./bin/prettier.js write"
}, "android": "adb reverse tcp:8888 tcp:8888; adb reverse tcp:9090 tcp:9090; react-native run-android --variant developmentDebug", |
I followed the step to get my machine's IP address from
Am I missing a step? |
@imdadahad -- i answered over on #671 |
Work like a charm on physical Android device with Expokit!! Thank you so much:) |
This throws |
Reactotron (version - v2.17.1)is showing 0 connections. Its showing I have set the id address in host in ReactotronConfig.js On running command - adb reverse --list I am running a react native project on emulator. Why it is not connecting ? |
Bro you are a life saver! Completely nailed it! |
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
This worked for me to get the connection, but XCode is still full of SocketRead errors. Does anyone know how to resolve that? I assume it's related to permissions needed to use the Reactotron port. |
If you are inconvenient to manually enter the IP when connecting reactotron to the actual device, try using this plugin. |
I feel like maybe I'm missing something obvious. I have my React Native iOS app using Reactotron fine when I build to an iOS simulator, but when I build to a device it's not working. I think I need to be port forwarding to port 9090 (like I do when I debug on a physical Android device), but is that possible on a physical iOS device?
I looked through the docs and didn't see any mention of this. If it's possible to remotely use Reacotron on iOS I'd love to add instructions to the docs for it.
The text was updated successfully, but these errors were encountered: