3

My mac-os using Wifi and when i move to other place my ip change and i always rebuild app for testing. Rebuild app is annoying.

  • How can i set Development Server IP Address in IOS after build and run on Physical Device?

on Android, i can set Development Server in Dev Menu, Dev Settings, Debug server host for device setting but nowhere found in IOS.

1
  • I have exactly this problem. I can't understand why this option is not available in ios. At first I thought it's just missed on simulator, but then realized there is no difference between simulated or physical device! Commented Nov 16, 2018 at 17:29

3 Answers 3

1
+50

Why couldn't you have a UIViewController with a UITextField that contains the URL or IP you want to use and a UIButton on it that saves and updates this, then store the result in UserDefaults and pull from that for a URL every time?

There are also other options like Firebase Remote Config, which I would use instead of the above if you have many variables you'd want to configure on the fly like this.

If you're just trying to swap the IP/port as you move to a new network, I'd still just store it in UserDefaults and make a page to update it, though.

Sign up to request clarification or add additional context in comments.

1 Comment

I jump to React Native without knowledge Native IOS or Android. I can set Development Server IP Address (in Developer Menu) in Android without re-build. But in Developer Menu of IOS don't have that useful option
0

I use this tool to solve the problem.

https://www.npmjs.com/package/http-server

http-server -p 8081 -P Http://{host}:{port} 

and use Xcode run app project.

2 Comments

That doesn't answer the question. The question is how to change the native app's bundle url dynamically at runtime, not how to host the packager
I dont wanna re-build and re-install App on physical device
0

Install react-native-DebugServerHost, link it and run again:

npm install react-native-DebugServerHost --save react-native link react-native run-ios 

Then new option will be appear in Developer Menu. After setting the ip of dev server you have to kill the app and run it again.

--

Pod integration

npm install react-native-DebugServerHost --save 

podFile file added:

pod 'DebugServerHost', :path => '../node_modules/react-native-DebugServerHost' pod install 

Manual integration:

Simply add the DebugServerHost folder to your project without any settings.

Repository: https://github.com/xuwening/react-native-debug-server-host

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.