Description
As described in this issue, react-devtools works great for iOS and Android in simulator/emulator, but only works on device on Android. I believe this is because PlatformConstants.ServerHost is not implemented on iOS, so it always falls back to attempting to connect to localhost, and therefore from your device the react-devtools are unreachable.
Reproduction Steps and Sample Code
Try to run react-devtools and connect with an iOS device
Solution
Add PlatformConstants.ServerHost to RCTPlatform, it should be a string constant that returns the ip:port string that points to the packager. With this change in place, react-devtools should work out of the box on device on iOS.
Additional Information
- React Native version: 0.45
- Platform: iOS
- Development Operating System: macOS
Description
As described in this issue, react-devtools works great for iOS and Android in simulator/emulator, but only works on device on Android. I believe this is because
PlatformConstants.ServerHostis not implemented on iOS, so it always falls back to attempting to connect to localhost, and therefore from your device the react-devtools are unreachable.Reproduction Steps and Sample Code
Try to run react-devtools and connect with an iOS device
Solution
Add
PlatformConstants.ServerHostto RCTPlatform, it should be a string constant that returns theip:portstring that points to the packager. With this change in place, react-devtools should work out of the box on device on iOS.Additional Information