title: Deploying Android app using Azure DevOps and editing APK for different environments
body: <p>this is a conceptual/design question.</p>
  
  <p>We have a <code>Xamarin Forms</code> apps and I'm creating a build and release pipeline for the Android version in Azure DevOps.
  We have 4 environments in total, internal, RC, staging and production.<br>
  For each of those I have created a <code>powershell</code> pre-build script that changes some configuration xml files, the app icons (different colours for different environments) and even the app name and package name (this way we can have all 4 installed on one device and be able to test using the different servers)</p>
  
  <p>Now I have a build in DevOps which runs the pre-build script to modify all those things, builds the project, signs the <code>apk</code> and publishes it. In my release pipeline, I cannot use this logic because I need to be able to deploy the different apps to their own test groups in <code>App Center</code>.<br>
  So I decided to split the build, it would just build and then the release pipeline would have stages - alpha would run the script and modify the app and sign it and put it for testing in an Alpha group, the Beta stage to beta etc...</p>
  
  <p>However, this means I have to modify the <code>.apk</code> after it was produced using powershell. For example, the <code>Android Manifest</code> file's content doesn't look like XML anymore and has strange <code>NUL</code>, <code>DLE</code> and other symbols in it. It'd make my life harder.</p>
  
  <p>Do I build all 4 packages in my Build pipeline with prepared packages for all environments? This would increase the time a lot so it's undesirable but it'd save me from having to edit APKs later...  </p>
  
  <p>What are best practices in these kind of situations, what are you able to suggest I do, change the way I do everything or what?</p>