Setting the active configuration in Xamarin Studio

Building cross-platform applications in Xamarin Studio, you often need to be working on one single platform at a given moment.

Since Xamarin Studio allows having both iOS and Android projects under the same solution, when building or deploying, they all get compiled. This is not very efficient, since you only want to deploy one platform at a time, either iOS or Android.

The solution configuration specifies how projects in that solution are to be built and deployed. A solution can have multiple configuration mappings specified (build configuration, release configuration etc), each containing a combination of a configuration and a platform.

To modify these, right click the solution in the Solution Explorer and select Options.

Screenshot 2013-12-01 14.38.15

In the Configurations section, select the Configuration Mappings. Chose the configuration you want to alter from the Configuration (Debug, Release, Ad-Hoc, AppStore) and Platform (iPhone, iPhoneSimulator, x86) drop-downs. Here you can select which projects will be active in that configuration. Click OK.

Next to the Run (Play) button, select the configuration you want to build or deploy, using the drop-downs. The projects in the solution tab are modified based on the selected configuration. The ones that are will be skipped next time you deploy are marked as “Not built in active configuration”.

Screenshot 2013-12-02 21.44.59

Setting the active configuration makes it easy to spot the projects of the platform you are currently working on and helps you by saving build and deploy time.

In some cases, these settings are also necessary. For example, including Windows Phone projects in a solution under Windows works just fine, but when running that solution on a Mac, the projects must be removed from the active configuration, otherwise they will cause build errors.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s