Reputation: 5537
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.
Upvotes: 18
Views: 8517
Reputation: 335
For now, there is still no direct way to do it. Create the bundle identifier in XCode and utilize that in your Xamarin project.
Upvotes: 0
Reputation: 5750
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
Upvotes: 1
Reputation: 43553
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.
Upvotes: 12