First create separate copies of AirshipConfig.plist
for all of your Xcode build configurations, and name them in the format AirshipConfig_$(CONFIGURATION).plist
(so e.g. AirshipConfig_Debug.plist
and AirshipConfig_Release.plist
). Then update their contents to whatever you want (e.g. set inProduction
to appropriate values.)
Then create a new "Run Script" Build Phase for your application target in Xcode, and give it the name "Copy Urban Airship config file to bundle". Add this as the contents of the script:
cp "${SRCROOT}/MyProjectName/AirshipConfig_${CONFIGURATION}.plist" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AirshipConfig.plist"
This will copy the config file for the correct build configuration into your app bundle, with the filename that the external library expects (AirshipConfig.plist
). Just ensure that the source path for the config files is correct in the above example.