8

I am setting up the production, staging and development stacks/configurations modes for my iOS and API (backend).

I figure the "RELEASE" mode definitely be when the application is public on the app store. I would like to know which configuration mode is used when the iOS application is distributed on TestFlight ?

I understood that the scheme is what determines which configuration mode is used. While I upload the .ipa to TestFlight the Archive scheme is used.

Therefore, now I would like to know if there is a way to have a different configuration for what is on TestFlight and what is released.

What I am trying to solve We use TestFight to distribute the application to our external testers and stake holders. Therefore would like that application to have a different configuration (e.g. SERVER_ENDPOINT_URL)

Thanks!

filip204
  • 25
  • 6
Prakash Raman
  • 13,319
  • 27
  • 82
  • 132
  • TestFlight doesn't use a configuration. Your scheme uses a configuration. If you want to know what configuration is used, look in the scheme that you used when you performed a build action. For a TestFlight build, you probably used Archive, and Archive probably uses Release. But why not just look and see? – matt Oct 12 '17 at 14:03
  • Thanks, I actually did not complete understand the relationship between scheme and configuration. Thanks for explain that though. I have edited my answer. Would be great if you have any additional thoughts. – Prakash Raman Oct 12 '17 at 14:07
  • OK but that makes even less sense. What you upload is a build. It is byte for byte identical to what you archived. You cannot change the configuration; the build already happened, i.e. when you archived. – matt Oct 12 '17 at 14:13
  • I understand. From what I understand the only way to distribute executables easily is via TestFlight. So how would have a different "set of vairables" to Testflight ? Maybe I am asking my question wrong. How would you distribute a test iOS application to your testers ? – Prakash Raman Oct 12 '17 at 14:16
  • "How would you distribute a test iOS application to your testers?" Exactly as you're doing it. If you wanted to use a special configuration for this build, you should have used it at the time you archived. – matt Oct 12 '17 at 15:35
  • Alright, thanks. That is what I arrived to as well. – Prakash Raman Oct 12 '17 at 17:14

3 Answers3

5

Well, I found out that I what I want to accomplish is not possible. Nor was the system built in a way to address my issue.

So what I am doing now is.

  • Archiving a build with "debug" configuration
  • Uploading to TestFlight and distributing the executable
  • After testing is complete
  • Recompile / re archive the build with "release" configuration
  • Upload to iTunesConnect and publish the application

Thanks!

Prakash Raman
  • 13,319
  • 27
  • 82
  • 132
1

Apps are distributed to TestFlight in release mode. If I understand your question right, which I'm not sure I do, at the basic level you want to use a different endpoint URL in your release version. You can differentiate between debug and release using the following

#if DEBUG
  static let baseURLString = "https://mydebugurl.com"
#else
  static let baseURLString = "https://myreleaseurl.com/"
#endif

However for that to work you need to add custom flags to your build settings, see this question for more info

I hope that answers your question

jackchmbrln
  • 1,672
  • 2
  • 14
  • 26
0

As far as I know, you won't be able to provide "a different set of variables" for builds pushed to testFlight and app release. That is what it is there for, to test the same byte code that will be published to the public.

With that said, what you could do: Create a "version" endpoint. So if you know that when you first push build 1.2, you will want stakeholders/external testers to see it first. Send a request to your prod server, passing along the build version that is being used, if version == 1.2, point all endpoint traffic to your special "development" endpoints(creating a hostName variable in your SessionManager device side, and setting that accordingly will make that really simple), else push the user on to use prod data.

Jacob Boyd
  • 672
  • 3
  • 19