zalmoxisus / remote-redux-devtools

Redux DevTools remotely.
http://zalmoxisus.github.io/monitoring/
MIT License
1.8k stars 138 forks source link

Can't get working react debugger on Android #45

Open pablopi opened 7 years ago

pablopi commented 7 years ago

Do I need any special configuration? Can you help?

zalmoxisus commented 7 years ago

You didn't provide any information to tell for sure what's wrong there.

In case you don't have process.env.NODE_ENV === 'development', make sure to set realtime parameter to true.

maysam commented 7 years ago

the same configuration work on macosx and ios simulator, but with android connected to ubuntu, ti doesn't show any state changes or actions etc

zalmoxisus commented 7 years ago

@maysam are you using the default configuration or with remotedev-server? If the latter, then don't forget about running adb to forward the port.

maysam commented 7 years ago

already done that, even mobile does open the debugger page automatically and I get to see the js errors in the console, it's just the state/action part that doesn't do anything

zalmoxisus commented 7 years ago

@maysam what app do you use for monitoring? Try the web version (and add the host and port there in the settings).

maysam commented 7 years ago

I get this in the console log

WebSocket connection to 'ws://localhost:8081/socketcluster/' failed: WebSocket is closed before the connection is established.

maysam commented 7 years ago

screenshot from 2016-12-09 19-51-41

zalmoxisus commented 7 years ago

Did you start remotedev-server on port 8081? Do you get any errors there?

zalmoxisus commented 7 years ago

Also try the web version as mentioned above, to see if it's the issue of remote-redux-devtools-on-debugger.

maysam commented 7 years ago

this is what I already had in my package.json

"remotedev": "remotedev-debugger --injectserver",
"postinstall": "npm run link && npm run remotedev && rndebugger-open"

}, "remotedev": { "hostname": "localhost", "port": 5678 },

needless to say, I am testing a reactnative app on android device

maysam commented 7 years ago

on the console I can see this error now

maysam@VPCZ226GG:~/workspace/bph$ [node-haste] Encountered an error while persisting cache:

SyntaxError: /home/maysam/workspace/bph/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/request/node_modules/node-uuid/test/test.js: Octal literal in strict mode (21:12) 19 | if (typeof(console) != 'undefined') { 20 | var color = {

21 | log: '\033[39m', | ^ 22 | warn: '\033[33m', 23 | error: '\033[31m' 24 | };

zalmoxisus commented 7 years ago

I'm not familiar with remote-redux-devtools-on-debugger architecture, maybe @jhen0409 can help. As I understand running npm install or npm run postinstall should start the server.

maysam commented 7 years ago

thanks, what's odd is that same config works just fine for xcode-iphone usecase

zalmoxisus commented 7 years ago

@maysam, you could use it without a local server. By default, if you don't set a hostname and port parameter, remote-redux-devtools will connect to remotedev.io. Then you can monitor the app on http://remotedev.io/local. So, no need for port forwarding to connect the device on lan, but it should be connected to the internet of course.

In case of remote-redux-devtools-on-debugger, I guess you could set hostname to remotedev.io.

jhen0409 commented 7 years ago

It looks like reactNative util not working on newer versions of React Native, it removed __fbBatchedBridge.RemoteModules, but looks we can get hostname via __fbBatchedBridgeConfig, so I'll fix it.

@maysam currently we need run adb reverse tcp:5678 tcp:5678 until I fix the above problem.