Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Configurations and Bundle Identifier

Is there a way to set the 'iOS Application Target Bundle Identifier' per 'Build Configuration' in Xamarin?

In XCode you can do that, which means that the same base code can be compiled for different enterprise customers (our case).

Xamarin Studio allows creating 'Build Configurations', and different provisioning profiles can be used in each one, however, it doesn't seem to have a way to set the Bundle Id.

Please advise. Thanks.

like image 743
rufo Avatar asked Aug 27 '13 19:08

rufo


People also ask

What should my bundle identifier be?

You can't delete bundle IDs that are being used by an app in App Store Connect“. The bundle ID string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.). The string should be in reverse-DNS format.

What is build identifier?

Build ID is a unique identification of binaries. It's an identifier of the application for concrete release. It can be 1.0-47/64.

What is bundle identifier in iOS?

Overview. The bundleIds resource represents the app's unique identifier that you can register, modify, and delete. You need a bundle ID before you can assign capabilities with the Bundle ID Capabilities resource or create a provisioning profile with the Profiles resource.


2 Answers

Not directly. However you can create pre (or post) build steps scripts (see Custom Commands in your project's options), which knows among other things the configuration being built, i.e. ${ProjectConfig}.

From the script you can use a tool, like PlistBuddy, to modify the Info.plist file values.

like image 187
poupou Avatar answered Oct 20 '22 21:10

poupou


You can create and enviroment variable containing the bundle id and add it to the plist file as a pre-build step, this is what I did in my project

if [ -n "$MY_BUNDLE_ID" ]; then
    /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $MY_BUNDLE_ID" ${PROJECT_DIR}/shell/shell-Info.plist
fi
like image 1
Pablo Retyk Avatar answered Oct 20 '22 21:10

Pablo Retyk