We have an Android app built with Mono for Android, and now we have desire to make a deployable test version for use in acceptance testing. It is important that the production version remains on the device and keeps working. What is the recommended way of creating a test build without causing interference like package name collisions?
Share
This solution applies to Mono for Android and allows you to change the package name of an application based on build configuration in Visual Studio:
AndroidManifest.xmltoAndroidManifest-Template.xmlCreate two .xslt files in the Properties folder:
manifest-transform.xslt:
manifest-copy.xslt:
Add two
XslTransformationtasks to theBeforeBuildtarget of your project file:Use the TEST symbol for conditional code:
You can now switch between test and regular app by changing build config 🙂