1 App Built for Enterprise and App Store

We have an app that we build both for enterprise and for app store. This requires us to make a couple settings

  1. The bundle identifier
  2. The Development team

Currently we use 2 branches with the enterprise branch as the master and the app store branch as the secondary, and we just merge master into the app store branch before submitting.

I would like to eliminate this step and build both versions at the same time.

What would be the best way to do this?

I have one additional requirement. It is a mixed Swift and objective-c project and I want the ability to have code specific to the app store version and code specific to the enterprise version. I envision using something like an #ifdef

Any suggestions on a solution to this, or does keeping it on 2 branches make the most technical sense.

-------------Problems Reply------------

  1. First you can duplicate Release Configuration in you settings to add AppStore Configuration. 1 App Built for Enterprise and App Store
  2. Add Prepocessor macros for every configuration you have.1 App Built for Enterprise and App Store
  3. Manage you schemes to have an App Store build configuration 1 App Built for Enterprise and App Store
  4. You will now have two targets but you will need to build one after the other.
  5. For the code part, on your code you will have to manage every macros in code.

You can create two targets (one for enterprise, one for App Store) within the project that share the same code, but are signed with different code-signing identities. That will also allow you to set separate pre-processor macros for your enterprise and App Store versions.

It depends on kind of differences between Enterprise and Apple Store versions.

If it's business logic differences then may be it makes sense to have two branches, because app versions can have different specs, so it will be difficult to support one code base.

If it's just configuration differences then I propose to use two targets (Enterprise, AppStore).
In every target build settings set suitable macros.

Example for Enterprise target:
1 App Built for Enterprise and App Store

The same has to be done for AppStore target build settings.

Usage in code:

Settings *settings = nil;
#ifdef ENTERPRISE_VERSION
settings = [[EnterpriseSettings alloc] init];
#else
settings = [[AppStoreSettings alloc] init];
#endif

In Swift you can use #if / #else / #endif macros:

var settings: Settings! = nil
#if ENTERPRISE_VERSION
settings = EnterpriseSettings()
#else
settings = AppStoreSettings()
#endif

In Xcode you can duplicate your build target. Then you can specify own team and bundle for each target. In addition you can have own macro defined to make variation in the code and/or include/exclude some source code files from each target

Category:ios Views:1 Time:2019-03-15

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.148 (s). 11 q(s)