language:unity:xcode_post_process_build
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
language:unity:xcode_post_process_build [2019/11/11 18:06] – 만듦 kieuns | language:unity:xcode_post_process_build [2024/04/23 22:44] (현재) – 바깥 편집 127.0.0.1 | ||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | |||
+ | <code csharp> | ||
+ | // 사용할 수 있을듯한 일부만 남겨둠 | ||
+ | // 그외 using은 따로 추가 | ||
+ | using UnityEngine; | ||
+ | using UnityEditor; | ||
+ | using UnityEditor.Callbacks; | ||
+ | using System.IO; | ||
+ | using UnityEditor.iOS.Xcode; | ||
+ | |||
+ | public class XCodeOnPostProcessBuild | ||
+ | { | ||
+ | [PostProcessBuild(1)] | ||
+ | static void OnPostProcessBuild(BuildTarget buildTarget, | ||
+ | { | ||
+ | if(buildTarget != BuildTarget.iOS) return; | ||
+ | |||
+ | // | ||
+ | // 원래 필요한 코드들.. | ||
+ | // | ||
+ | |||
+ | // | ||
+ | // Info.plist 수정 | ||
+ | // | ||
+ | |||
+ | // Get plist | ||
+ | var plistPath = Path.Combine(path, | ||
+ | PlistDocument plist = new PlistDocument(); | ||
+ | plist.ReadFromString(File.ReadAllText(plistPath)); | ||
+ | |||
+ | // Get root | ||
+ | PlistElementDict rootDict = plist.root; | ||
+ | |||
+ | // 빌드에서 암호화를 사용하지 않는 경우에는 다음 빌드와 함께 수출 규정 준수 정보를 제공할 필요가 없도록 Info.plist 파일에 키 문자열 값을 사용하십시오. | ||
+ | rootDict.SetBoolean(" | ||
+ | |||
+ | // Write to file | ||
+ | File.WriteAllText(plistPath, | ||
+ | |||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||