Unity to iOS, info.plist Overwritten After PostProcessBuild2019 Community Moderator ElectionFrom Unity to iOS, how to perfectly automate frameworks, settings and plist?Unity: Sending OSC messages to MSP/PD clientFacebook Unity SDK, broken post processor for iOSDynamically Load and Activate a dataset (vuforia and unity)Not ask user permission to access camera in other languages than Englishhow to support multiple displays Unity UWP appsPhoto capture permission problems in iOS 11iOS 11 not asking permission for access photo from the appUIImagePickerController working without NS Photo Library and Camera descriptionsUnity (Vuforia) project integrated in Android project shows a black screen on startupHow to change camera input(DJI drone camera) in unity and export to android studio
What is the likely impact on flights of grounding an entire aircraft series?
Replacing Windows 7 security updates with anti-virus?
Good allowance savings plan?
Running a subshell from the middle of the current command
What Happens when Passenger Refuses to Fly Boeing 737 Max?
How could a female member of a species produce eggs unto death?
Excess Zinc in garden soil
This equation is outside the page, how to modify it
Straight line with arrows and dots
Deleting missing values from a dataset
Silly Sally's Movie
How does Dispel Magic work against Stoneskin?
Is this animal really missing?
How to make readers know that my work has used a hidden constraint?
What is the blue range indicating on this manifold pressure gauge?
What to do when during a meeting client people start to fight (even physically) with each others?
Time dilation for a moving electronic clock
Gravity alteration as extermination tool viable?
If Invisibility ends because the original caster casts a non-concentration spell, does Invisibility also end on other targets of the original casting?
A curious inequality concerning binomial coefficients
What happens with multiple copies of Humility and Glorious Anthem on the battlefield?
infinitive telling the purpose
Nimitta - sutta references
Force user to remove USB token
Unity to iOS, info.plist Overwritten After PostProcessBuild
2019 Community Moderator ElectionFrom Unity to iOS, how to perfectly automate frameworks, settings and plist?Unity: Sending OSC messages to MSP/PD clientFacebook Unity SDK, broken post processor for iOSDynamically Load and Activate a dataset (vuforia and unity)Not ask user permission to access camera in other languages than Englishhow to support multiple displays Unity UWP appsPhoto capture permission problems in iOS 11iOS 11 not asking permission for access photo from the appUIImagePickerController working without NS Photo Library and Camera descriptionsUnity (Vuforia) project integrated in Android project shows a black screen on startupHow to change camera input(DJI drone camera) in unity and export to android studio
Background:
- Using Unity 2018.3.5f1 to build iOS Project
- Using PostProcessBuild Attribute to change info.plist
- Code worked in a different project in Unity 2018.2.1f1
I believe I'm doing what's suggested in this article: From Unity to iOS, how to perfectly automate frameworks, settings and plist?
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.
It seems that Unity is overwriting the info.plist file after the PostProcessBuild functions are running.
Code is placed in /Assets/Editor folder in Unity project.
Here's one of my functions:
[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());
ios unity3d post-build-event
add a comment |
Background:
- Using Unity 2018.3.5f1 to build iOS Project
- Using PostProcessBuild Attribute to change info.plist
- Code worked in a different project in Unity 2018.2.1f1
I believe I'm doing what's suggested in this article: From Unity to iOS, how to perfectly automate frameworks, settings and plist?
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.
It seems that Unity is overwriting the info.plist file after the PostProcessBuild functions are running.
Code is placed in /Assets/Editor folder in Unity project.
Here's one of my functions:
[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());
ios unity3d post-build-event
Did you look for other PostProcessBuildAttribute with an higher order that could be used by others scripts or libraries you included?
– dogiordano
Mar 6 at 21:25
add a comment |
Background:
- Using Unity 2018.3.5f1 to build iOS Project
- Using PostProcessBuild Attribute to change info.plist
- Code worked in a different project in Unity 2018.2.1f1
I believe I'm doing what's suggested in this article: From Unity to iOS, how to perfectly automate frameworks, settings and plist?
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.
It seems that Unity is overwriting the info.plist file after the PostProcessBuild functions are running.
Code is placed in /Assets/Editor folder in Unity project.
Here's one of my functions:
[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());
ios unity3d post-build-event
Background:
- Using Unity 2018.3.5f1 to build iOS Project
- Using PostProcessBuild Attribute to change info.plist
- Code worked in a different project in Unity 2018.2.1f1
I believe I'm doing what's suggested in this article: From Unity to iOS, how to perfectly automate frameworks, settings and plist?
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.
It seems that Unity is overwriting the info.plist file after the PostProcessBuild functions are running.
Code is placed in /Assets/Editor folder in Unity project.
Here's one of my functions:
[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());
ios unity3d post-build-event
ios unity3d post-build-event
asked Mar 6 at 17:35
Philip Anthony MusePhilip Anthony Muse
165
165
Did you look for other PostProcessBuildAttribute with an higher order that could be used by others scripts or libraries you included?
– dogiordano
Mar 6 at 21:25
add a comment |
Did you look for other PostProcessBuildAttribute with an higher order that could be used by others scripts or libraries you included?
– dogiordano
Mar 6 at 21:25
Did you look for other PostProcessBuildAttribute with an higher order that could be used by others scripts or libraries you included?
– dogiordano
Mar 6 at 21:25
Did you look for other PostProcessBuildAttribute with an higher order that could be used by others scripts or libraries you included?
– dogiordano
Mar 6 at 21:25
add a comment |
1 Answer
1
active
oldest
votes
Thanks @dogiordano, that was the problem. A colleague added a library to the project that included a PostProcessBuild attribute with no calling order defined like this:
[PostProcessBuild]
whereas my 2 callbacks had the order specified:[PostProcessBuild(0)][PostProcessBuild(1)]
There's nothing in the doc that describes what happens in this case:
https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
So, I tried my functions with (1) and (2) to see if the unspecified order would take the (0) slot and it does not. Like this:[PostProcessBuild] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
So, if you don't specify a callback order, those functions are called after the functions that have an order specified.
I specified the callback order for all 3, and it works as expected.[PostProcessBuild(0)] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55029079%2funity-to-ios-info-plist-overwritten-after-postprocessbuild%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks @dogiordano, that was the problem. A colleague added a library to the project that included a PostProcessBuild attribute with no calling order defined like this:
[PostProcessBuild]
whereas my 2 callbacks had the order specified:[PostProcessBuild(0)][PostProcessBuild(1)]
There's nothing in the doc that describes what happens in this case:
https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
So, I tried my functions with (1) and (2) to see if the unspecified order would take the (0) slot and it does not. Like this:[PostProcessBuild] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
So, if you don't specify a callback order, those functions are called after the functions that have an order specified.
I specified the callback order for all 3, and it works as expected.[PostProcessBuild(0)] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
add a comment |
Thanks @dogiordano, that was the problem. A colleague added a library to the project that included a PostProcessBuild attribute with no calling order defined like this:
[PostProcessBuild]
whereas my 2 callbacks had the order specified:[PostProcessBuild(0)][PostProcessBuild(1)]
There's nothing in the doc that describes what happens in this case:
https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
So, I tried my functions with (1) and (2) to see if the unspecified order would take the (0) slot and it does not. Like this:[PostProcessBuild] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
So, if you don't specify a callback order, those functions are called after the functions that have an order specified.
I specified the callback order for all 3, and it works as expected.[PostProcessBuild(0)] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
add a comment |
Thanks @dogiordano, that was the problem. A colleague added a library to the project that included a PostProcessBuild attribute with no calling order defined like this:
[PostProcessBuild]
whereas my 2 callbacks had the order specified:[PostProcessBuild(0)][PostProcessBuild(1)]
There's nothing in the doc that describes what happens in this case:
https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
So, I tried my functions with (1) and (2) to see if the unspecified order would take the (0) slot and it does not. Like this:[PostProcessBuild] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
So, if you don't specify a callback order, those functions are called after the functions that have an order specified.
I specified the callback order for all 3, and it works as expected.[PostProcessBuild(0)] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
Thanks @dogiordano, that was the problem. A colleague added a library to the project that included a PostProcessBuild attribute with no calling order defined like this:
[PostProcessBuild]
whereas my 2 callbacks had the order specified:[PostProcessBuild(0)][PostProcessBuild(1)]
There's nothing in the doc that describes what happens in this case:
https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
So, I tried my functions with (1) and (2) to see if the unspecified order would take the (0) slot and it does not. Like this:[PostProcessBuild] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
So, if you don't specify a callback order, those functions are called after the functions that have an order specified.
I specified the callback order for all 3, and it works as expected.[PostProcessBuild(0)] - other library[PostProcessBuild(1)] - mine[PostProcessBuild(2)] - mine
answered Mar 7 at 3:36
Philip Anthony MusePhilip Anthony Muse
165
165
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55029079%2funity-to-ios-info-plist-overwritten-after-postprocessbuild%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you look for other PostProcessBuildAttribute with an higher order that could be used by others scripts or libraries you included?
– dogiordano
Mar 6 at 21:25