Skip to content

Add PlatformConstants.ServerHost for iOS to support react-devtools on device #14431

Description

@brentvatne

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: iOSiOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions