

Below you can review what it should look like. These property groups should contain a AndroidManifest node each. Typically, you should find a couple of PropertyGroup nodes one for each build configuration.

When you open it up, you will see that the csproj is nothing but a xml file as well. This can be done with an external editor like Notepad++ or from Visual Studio directly.
XAMARIN APPICON JSON ANDROID
For this, we need to edit the Android project csproj file.
XAMARIN APPICON JSON HOW TO
Now that we have this file prerequisite in place, it is time to look at how to select the right file at compile-time. But of course you can repeat this process for any number of environments that you might have. In production you probably want to have a non-postfixed package identifier and the app label should not specify the current environment since it is not relevant to the end-user. In this scenario I just have a dev and production scenario. In the below code you can see a sample manifest file. On Android icons are referenced from the AndroidManifest.xml. NET based project for that matter.įirst, let’s have a look at Android. While this project is a Xamarin.Forms project, this method works for traditional Xamarin as well. The sample code that I will be using for this post can be found on my GitHub page: The implementation per platform differs, because different infrastructure is used for each platform to incorporate icons and reference them. Now the question is: how do we implement this? To learn more, read the Microsoft Docs on this subject. Setting up the actual build configuration can be a very extensive process and is beyond the scope of this post. But don’t worry, I’ll guide you through the basics here. To read more on the MSBuild conditions, please refer to this documentation page. With the power of MSBuild you can include different files – which hold different content – depending on the build configuration or other conditions. Since some while now, Xamarin projects use the MSBuild process for building. You could even change the whole theme altogether! One of them is the situation I have described above, another could be that you maybe want to change the display name of your app depending on a build configuration. In this post I will show you how to include and select different app icons based on the build configuration. This is just one of the many situations that can be implemented by making use of the MSBuild conditions. When you start sending out versions of your app for testing purposes in a corporate environment, it might be desirable to being able to distinguish them, or maybe even run two version simultaneously.
