How-to define compile-time symbol for Xamarin builds on bitrise

You can assign compile-time symbols for the desired project configuration platform combination to branch your code in compile time. This way is the DEBUG symbol assigned to Debug build configuration by default.
To define a symbol, you can either do this in your project options:

  • open your solution file in your favorite Xamarin IDE
  • open the desired project’s Project Options (right click on the project in the project navigator, select Options)
  • select Build/Compiler tab in the side menu
  • list your symbols in the Define Symbols field for the desired Configuration Platform combination

If you do not want to assign permanent symbols to a project’s configuration platform combination, you can define ad-hoc symbols by adding them as a build command parameter in Xamarin Archive step.
To define a symbol for your builds:

  • open the app on bitrise.io
  • open the Workflow Editor (Workflow tab)
  • select Xamarin Archive step
  • expand the Debug step input group
  • specify your symbol for (Experimental) Options to append to the PLATFORM build command input in the format: /p:DefineConstants="SYMBOL1;SYMBOL2"
1 Like