Version: 2023.1
언어: 한국어
Android 기기에서 디버깅
Simulate an Android device

Android 심볼

애플리케이션 디버그를 수행할 수 있도록 Unity는 네이티브 Unity 라이브러리용 심볼 파일이 포함된 패키지를 생성할 수 있습니다. 심볼 파일에는 액티브 메모리 주소를 메서드 이름처럼 사용할 수 있는 정보로 변환하는 표가 포함되어 있습니다. 이러한 이동 프로세스를 기호화라고 합니다. 심볼 패키지를 Google Play 콘솔에 업로드하여 Android Vitals 대시보드에서 사람이 읽을 수 있는 스택 추적을 볼 수 있습니다.

다음과 같이 두 종류의 심볼 파일이 있습니다.

  • Public: A small file that contains a symbol table. For more information, refer to Public symbols.
  • Debug: Contains everything that a public symbol file contains, and full debugging information that you can use for more in-depth debugging. For more information, refer to Debugging symbols.

다음의 라이브러리용 심볼 파일을 생성할 수 있습니다.

  • libmain: 로직을 로드하는 초기 Unity 엔진을 담당합니다.
  • libunity: Unity 엔진 코드입니다.
  • libil2cpp: C++ 코드로 변환된 프로젝트의 C# 스크립트를 포함합니다.

Unity는 libmainlibunity 심볼 파일을 생성하고, Gradlelibil2cpp 심볼 파일을 생성합니다.

공용 심볼

공용 심볼 파일에는 함수 주소를 사람이 읽을 수 있는 문자열로 확인하는 정보가 포함되어 있습니다. Unity는 --strip-debug 파라미터를 사용하여 더 심층적인 디버그 정보를 제거하는 공용 심볼을 생성합니다. 디버그 정보가 들어있지 않아서 공용 심볼 파일과 공용 심볼 패키지가 심볼 디버깅 파일과 심볼 디버깅 패키지보다 더 작습니다.

심볼 디버깅

심볼 디버깅 파일에는 모든 디버깅 정보와 심볼 표가 포함되어 있습니다. 심볼 디버깅 파일을 사용하여 다음과 같은 동작을 수행할 수 있습니다.

  • 스택 추적을 해결하고 소스 코드를 사용할 수 있는 애플리케이션을 디버그할 수 있습니다.
  • 애플리케이션에 네이티브 디버거를 연결하여 코드를 디버그할 수 있습니다.

Unity uses the --only-keep-debug parameter to create debugging symbols. For more information, refer to –only-keep-debug in the Linux user manual.

Note: If debugging symbols aren’t available, Unity places a public symbol file in your project at build time. For the libmain and libunity libraries, debugging symbols aren’t available and Unity always generates public symbol files.

Custom symbols

You can instruct Unity to include additional symbol files. This is useful if you use shared libraries and want your local debugger, and Google Play, to resolve the shared library stack traces if the application crashes.

To make Unity include a custom symbols file:

  1. In the Project window, select a plug-in that has a .so file extension.
  2. In the Inspector, find the Platform settings section.
  3. Set CPU to the CPU architecture that the symbols file is compatible with.
  4. Set Shared Library Type to Symbol.

Whenever Unity generates a symbols package, it adds the additional symbol files to the symbols package.

If you want to make Unity include a custom symbols file from a C# script, the UnityEditor.Android namespace includes the following APIs to set the CPU and Shared Library Type respectively:

Note: The symbols file name must match the name of the shared library that the symbols file is for. For example, if a shared library is called mylibrary.so, the symbols file must also be named mylibrary.so. To avoid file name collisions, the symbols file and the shared library must be in separate directories.

Important: Ensure the symbols file is up to date and compatible with the shared library that contains the executable code. If you don’t, your local debugger and Google Play will fail to resolve stack traces for code in the shared library.

심볼 패키지 생성

애플리케이션을 위한 심볼 패키지 생성을 활성화하는 데는 두 가지 방법이 있습니다.

To enable symbols package generation through the Build Settings window:

  1. 빌드 설정 창(메뉴: File > Build Settings)을 엽니다.

  2. Android 플랫폼을 선택합니다.

  3. 다음 중 한 가지 방법으로 Create symbols.zip을 설정합니다.

심볼 패키지 생성을 활성화한 후 프로젝트 빌드가 libmainlibunity 라이브러리용 심볼 파일이 포함된 .zip 파일을 생성합니다. 스크립팅 백엔드IL2CPP로 설정하면 .zip 파일에는 libil2cpp 라이브러리용 심볼 파일이 포함됩니다. Unity는 이 심볼 패키지를 출력 디렉토리 내부에 배치합니다.

Android 빌드 설정에서 Export Project를 활성화하면 Unity는 프로젝트를 빌드하지 않습니다. 대신 Unity는 Android Studio용 프로젝트를 익스포트하고 libmainlibunity용 심볼을 생성하여 출력 디렉토리의 unityLibrary/symbols/<architecture>/ 내부에 배치합니다. Android Studio에서 익스포트된 프로젝트를 빌드할 때 Gradle은 libil2cpp 심볼 파일을 생성하여 unityLibrary/symbols/<architecture>/ 디렉토리 내부에 libmainlibunity 심볼 파일과 함께 배치합니다.

Google Play 콘솔에서 심볼 사용

After you upload your application to Google Play, you can upload a public symbols package for it. For information on how to do this, refer to Google’s documentation: Deobfuscate or symbolicate crash stack traces.

참고: Google Play는 심볼 패키지가 업로드되기 전에 애플리케이션이 받은 크래시를 기호화하지 않습니다.

Android 기기에서 디버깅
Simulate an Android device
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961