Linked Questions

Popular Questions

How to change $(PRODUCT_BUNDLE_IDENTIFIER) in Xcode?

Asked by At

I am build different flavor of Flutter app with different Firebase environment (development and production). I need set different bundle ID for development and production in Xcode for iOS apps.

I am use schemes to configure the different flavor (in Build Settings I add environment value for every configuration).

But I have big issue with change $(PRODUCT_BUNDLE_IDENTIFIER). I need add suffix .development to normal app id for development app id.

I have try follow this method(use User Defined Settings) and change info.plist to get variable from User Defined Settings but it not work.

Error is:

The operation couldn’t be completed. Application “$(EXAMPLE_BUNDLE_ID)" is unknown to FrontBoard.

So it seem when pass in User Defined Setting it is not interpolate correct.

I have also try mix method of add default PRODUCT_BUNDLE_IDENTIFIER and User Defined Settings. For example: com.example.app$(EXAMPLE_BUNDLE_ID) where EXAMPLE_BUNDLE_ID = .development

I also try reference User Defined Setting $(EXAMPLE_BUNDLE_ID) by direct add it to Bundle Identifier in Target General tab under ‘Identity’. But this then change to : -- EXAMPLE_BUNDLE_ID-

I have also try in info.plist use $(PRODUCT_BUNDLE_IDENTIFIER)$(EXAMPLE_BUNDLE_ID) for Bundle Identifier value. But this give similar error:

The operation couldn’t be completed. Application “com.example.app$(EXAMPLE_BUNDLE_ID)" is unknown to FrontBoard.

Again this look like interpolation issue.

Anyone know solution? I have look but cannot find answer.

This easy for android because just use applicationIdSuffix ".development” in productFlavors. But I cannot find way like this for Xcode.

Related Questions