title: Unity to iOS, info.plist Overwritten After PostProcessBuild
body: <p>Background: </p>
  
  <ol>
  <li>Using Unity 2018.3.5f1 to build iOS Project</li>
  <li>Using PostProcessBuild Attribute to change info.plist</li>
  <li>Code worked in a different project in Unity 2018.2.1f1</li>
  </ol>
  
  <p>I believe I'm doing what's suggested in this article: <a href="https://stackoverflow.com/questions/54370336/from-unity-to-ios-how-to-perfectly-automate-frameworks-settings-and-plist">From Unity to iOS, how to perfectly automate frameworks, settings and plist?</a></p>
  
  <p>I've confirmed that the PostBuildProcess function is called and the info.plist is changed.  I log the output and it appears correct.  I also saved a 2nd file in my code (info2.plist) and it contains all the changes I expect.  However, the original file (info.plist) is overwritten with different values.</p>
  
  <p>It seems that Unity is overwriting the info.plist file <strong>after</strong> the PostProcessBuild functions are running. </p>
  
  <p>Code is placed in /Assets/Editor folder in Unity project.</p>
  
  <p>Here's one of my functions:</p>
  
  <pre><code>[PostProcessBuild(1)]
  public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
  {
      if (buildTarget == BuildTarget.iOS)
      {
          // Get plist file and read it.
          string plistPath = pathToBuiltProject + "/Info.plist";
          Debug.Log("In the ChangeXCodePlist, path is: " + plistPath);
          PlistDocument plist = new PlistDocument();
          plist.ReadFromString(File.ReadAllText(plistPath));
          Debug.Log("In the ChangeXCodePlist");
  
          // Get root
          PlistElementDict rootDict = plist.root;
  
          // Required when using camera for demos, e.g. AR demos.
          rootDict.SetString("NSCameraUsageDescription", "Uses the camera for Augmented Reality");
  
          // Required when using photo library in demo (i.e. reading library).
          rootDict.SetString("NSPhotoLibraryUsageDescription", "${PRODUCT_NAME} photo use");
  
          // Required when adding images to photo library in demos.
          rootDict.SetString("NSPhotoLibraryAddUsageDescription", "${PRODUCT_NAME} photo use");
  
          //ITSAppUsesNonExemptEncryption, this value is required for release in TestFlight.
          rootDict.SetBoolean("ITSAppUsesNonExemptEncryption", false);
  
          Debug.Log("PLIST: " + plist.WriteToString());
  
          // Write to file
          File.WriteAllText(plistPath, plist.WriteToString());
          File.WriteAllText(pathToBuiltProject + "/info2.plist", plist.WriteToString());
      }
  }
  </code></pre>