Version: 2021.1
모바일 개발자 체크리스트
프로파일링

Crashes

Checklist for crashes

  • 코드 스트리핑을 비활성화합니다(또한 iOS의 경우 “예외와 함께 느리게”로 설정).
  • Follow the instructions in Optimizing the size of the built iOS Player to make sure your game does not crash with stripping on iOS.
  • Verify it is not because of out of memory (restart your device, use the device with maximum RAM for the platform, be sure to watch the logs).

Editor.log - on the editor

The Debug messages, warnings and errors all go to the console. Unity also prints status reports to the console - loading assets, initializing mono, graphics driver info.

If you are trying to understand what is going on, look at the editor.log file, which provides more detailed information than the console. You can try to understand what’s happening, and watch the full log of your coding session. This will help you track down what has caused Unity crash to crash or find out what’s wrong with your assets.

Unity는 또한 장치에 몇 가지 정보를 출력합니다(iOS 장치의 Android용 로그캣 콘솔 및 Xcode gdb 콘솔).

Debugging on Android

  1. Use the DDMS or ADB tool
  2. Watch the stacktrace. Use c++filt (part of the ndk) or other methods to decode the mangled function calls
  3. Look at the .so file that the crash occurs on:
    1. libunity.so - the crash is in the Unity code or the user code
    2. libdvm.so - the crash is in the Java world, somewhere with Dalvik. So find Dalvik’s stacktrace, look at your JNI code or anything Java-related (including your possible changes to the AndroidManifest.xml).
    3. libmono.so - either a Mono bug or you’re doing something Mono strongly dislikes

If the crashlog does not help you can disassemble it to get a rough understanding of what has happened: 1. Use ARM EABI tools from the Android NDK like this: objdump.exe -S libmono.so >> out.txt. 1. Look at the code around pc from the stacktrace.. 1. Try to match that code within the fresh out.txt file. 1. Scroll up to understand what is happening in the method it occurs in.

Debugging on iOS

  1. Xcode has built in tools to enable you to debug your app.
  2. 전체 gdb 스택 - 모든 스레드 역추적
  3. Enable soft-null-check: Enable development build and script debugging. Now uncaught null ref exceptions will be printed to the Xcode console with the appropriate managed call stack
  4. Try turning the “fast script call” and code stripping off. It may stop some random crashes, like those caused by using some rare .NET methods or reflection.

Strategy

  1. 충돌이 발생한 스크립트를 파악하고 장치에서 모노 개발을 사용하여 디버깅해야 합니다.
  2. If the crash seems to not be in your code, take a closer look at the stacktrace, there should be a hint of something happening. If you believe the crash happens because of a problem with Unity, see the Known issues tracker or submit a bug.
모바일 개발자 체크리스트
프로파일링