need Ad-hoc distribution app using development environment

91 Views Asked by At

My project is still in objective-c.

In my iOS project's info, in "Preprocessor Macros" section, I have defined:

Debug:   DEV_SERVER=1
Release: DEV_SERVER=0

In my source code I have:

#if DEV_SERVER
#define SERVER @"https://staging.myhost.com"
#else
#define SERVER @"https://myhost.com"
#endif

So, in release build I use production server, otherwise, using staging server.

The code communicating with backend create NSURL instance by:

NSURL *url = [NSURL URLWithString:SERVER];

Everything works as expected.

But now, I would like to make an ad-hoc distribution to tester to test the app. I made the IPA file ready, but the ad-hoc distribution use production server. But we would like to use staging server for the ad-hoc distribution version app.

How to have the ad-hoc distribution app use staging server? Meanwhile, keep the distribution to Apple Store using production server? What is the best way to achieve this?

0

There are 0 best solutions below