This is probably a long shot but doesn't hurt to ask...
Do you think it's possible to obtain the IP address of the build host when building for iOS in Objective-C under xcode?
It'd be useful for my testing if it were possible.
For example:
NSString* backendUrl = [NSString stringWithFormat:@"http://%@:5000/", HOST_IP];
Where I would expect HOST_IP
(if there was something like that) to be something like this, but of course automatically controlled at build time to hold the correct IP:
#define HOST_IP @"172.76.77.5"
No convenient solution, but here are some options to consider.
In your #define, type your computer's Host-Name (if it's on a LAN) - http://mylaptop:5000/ or simply sign up to a free domain @ http://www.no-ip.com/
If it's necessary to specifically have a #define macro that contains your IP Address, you could simply write a small bash script that updates the defined ip in your .m/.cpp/.h file or whatever holds this #define. then you can add the script as a pre-build phase, or just run the script when you know that the IP Address has changed. although I admit it's kinda hackish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With