Android용 애플리케이션을 빌드하는 데에는 상당한 시간이 소요될 수 있습니다. 개발 과정 중 더 빠른 반복을 위해 애플리케이션 패키지를 다시 빌드하지 않고 패치할 수 있습니다. 애플리케이션 패키지를 패치하면 Unity는 마지막 패치 이후에 변경한 파일만 처리하여 연결된 Android 기기로 전송합니다.
플랫폼 | 애플리케이션 패치 |
---|---|
Android | 지원됨 |
ChromeOS | 미지원 |
애플리케이션을 패치하려면 Unity 에디터를 사용하거나, 자체 빌드 파이프라인을 구현한다면 스크립팅 API를 사용할 수 있습니다.
애플리케이션을 처음 패치하면 Unity가 기기에 패치 애플리케이션 환경을 설정합니다. 이로써 첫 번째 패치 다음부터는 패치에 걸리는 시간이 단축됩니다.
Unity 에디터에서 애플리케이션 패치하려면 다음 단계를 따르십시오.
자체 빌드 파이프라인을 구현하는 경우 애플리케이션을 패치하기 위해 스크립팅 API를 사용할 수 있습니다. 이렇게 하려면 [BuildPipeline.BuildPlayer](../ScriptReference/ BuildPipeline.BuildPlayer.html) 메서드에 BuildOptions.BuildScriptsOnly와 BuildOptions.PatchPackage 옵션을 전달하십시오.
예제:
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
buildPlayerOptions.scenes = new[] { "Assets/Scene1.unity"};
buildPlayerOptions.target = BuildTarget.Android;
// Use Patch & Run for all builds for optimal turn-around times.
// (In prior versions, an initial regular Build & Run was necessary.)
buildPlayerOptions.options = BuildOptions.PatchPackage | BuildOptions.AutoRunPlayer | BuildOptions.Development;
BuildPipeline.BuildPlayer(buildPlayerOptions);
애플리케이션을 패치하면 Unity는 다음을 수행하십시오.
/storage/emulated/0/Android/data/<PackageName>/pram-shadow-files/
에 있는 애플리케이션의 캐시 폴더 내 디렉토리에 저장합니다./data/data/<PackageName>/pram-shadow-files/lib/
)에 저장합니다.애플리케이션이 시작되면 APK 내부에 마커 파일이 있는지 확인합니다. 마커가 존재하면 애플리케이션은 파일 읽기를 pram-shadow-files
디렉토리로 리디렉트합니다.
Build & Run은 패치 파일을 지우지 않습니다. 대신 APK 파일을 설치합니다. 이렇게 하면 pram-shadow-files
디렉토리로의 리디렉션이 비활성화됩니다. 즉, 후속 패치 빌드는 변경되지 않은 파일을 재사용할 수 있습니다.
Android 스토리지 설정을 사용하여 애플리케이션의 캐시를 삭제할 수 있습니다. 그러면 애플리케이션 패치 빌드 프로세스에 의해 설치된 패치 파일이 삭제됩니다.
애플리케이션의 캐시 삭제 방법은 Android 기기에 따라 다릅니다. 기기별 삭제 방법을 찾으려면 다음 단계를 따르십시오.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.