zalmoxisus / remotedev-server

Connect Redux DevTools extension to a remote app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"adb reverse" Still Necessary with --injectserver=reactnative

HAMPLENI opened this issue · comments

Setup

OS

Windows 10

remote-redux-devtools

"remote-redux-devtools": "0.5.0"

const composeEnhancers = composeWithDevTools({hostname: "localhost", port: 8000});

remotedev-server

"remotedev-server": "0.2.4"

remotedev --hostname=localhost --port=8000 --injectserver=reactnative

remotedev-app

    "react": "15.6.2",
    "react-dom": "15.6.2",
    "react-scripts": "1.0.17",
    "remotedev-app": "0.10.8"

<DevToolsApp socketOptions={{hostname: "localhost", port: "8000", autoReconnect: true}} />

Potential Issue

According to this section of README.md, I should not need to run

adb reverse tcp:8000 tcp:8000

since I am using injectserver:

https://github.com/zalmoxisus/remotedev-server#connect-from-android-device-or-emulator

I get the following error in the debugger for the React Native app if I do not execute adb reverse tcp:8000 tcp:8000:

remote-redux-devtools\lib\devTools.js:216

name: SocketProtocolError
message: "Socket hung up"
code: 1006
stack:

SocketProtocolError: Socket hung up
at SCSocket._onSCClose (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:85993:15)
at SCTransport. (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:85702:12)
at SCTransport.Emitter.emit (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:86425:20)
at SCTransport.SCEmitter.emit (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:86353:26)
at SCTransport._onClose (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:87123:30)
at WebSocket.wsSocket.onerror (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:87057:12)
at WebSocket.dispatchEvent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:11240:35)
at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:10317:16
at RCTDeviceEventEmitter.emit (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:10466:35)
at MessageQueue.__callFunction (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:3237:42)

It works properly if I execute:

adb reverse tcp:8000 tcp:8000

Is this to be expected?

If so, I would like to find a way to make sure that port is forwarded whenever an Android emulator or connected device is running off of my machine.