Detox icon indicating copy to clipboard operation
Detox copied to clipboard

(WIP) Facilitate testing React Native apps in debug mode on Android

Open noomorph opened this issue 3 years ago • 4 comments

Describe your idea

Currently, Detox does not reverse TCP port of Metro bundler, which is confusing.

We could do a better job for our AndroidDriver implementation upon launchApp:

  • if process.env.RCT_METRO_PORT is defined, call device.reverseTcpPort(...)
  • otherwise, call device.reverseTcpPort(8081) – that's the default port.

noomorph avatar Jul 19 '22 08:07 noomorph

@noomorph I'm largely against predisposing particular traits of usage by our users. This sounds more like a thing to introduce as an optional configuration; Preset in mind - might be a better idea if it comes out-of-the-box from that direction, rather than from Detox itself.

d4vidi avatar Aug 07 '22 14:08 d4vidi

@d4vidi you might remember that the alternative approach was to define in app configuration the list of ports to reverse:

({
  type: "android.apk",
  binaryPath: "...",
  reversePorts: ['tcp:8081'] // or [8081] or { 8081: 10000 } or { 'udp:1000': 'udp:2000' } or something like that
})

noomorph avatar Aug 08 '22 06:08 noomorph

Yes, that is true indeed! Didn't we agree upon that? If so, would androidReversePorts make a better option?

d4vidi avatar Aug 11 '22 20:08 d4vidi

@noomorph did you happen to do anything in regards?

d4vidi avatar Aug 29 '22 12:08 d4vidi