「Unity/sentry/BREAKPOINT対応」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==BREAKPOINT対応== iOSのビルド設定のOtherSettingsのOptimizationのScriptCallOptimizationを、 "Slow and Safe"から"Fast but no Exceptions"にして、Exceptio...」) |
(→sentryのログ調査) |
||
| (同じ利用者による、間の4版が非表示) | |||
| 行14: | 行14: | ||
button1.onClick.AddListener(() => | button1.onClick.AddListener(() => | ||
{ | { | ||
| − | + | ExecException(); | |
}); | }); | ||
} | } | ||
| − | void | + | void ExecException() |
{ | { | ||
| − | throw new Exception(" | + | throw new Exception("例外エラー!!"); |
} | } | ||
} | } | ||
| 行42: | 行42: | ||
<pre> | <pre> | ||
System.Exception | System.Exception | ||
| − | ExceptionScene in | + | ExceptionScene in ExecException |
| − | + | 例外エラー!! | |
</pre> | </pre> | ||
| 行50: | 行50: | ||
EXC_BREAKPOINT | EXC_BREAKPOINT | ||
InitCrashHandling | InitCrashHandling | ||
| − | 000000000000000000000000000>:0 > Exception > text.Exec () [0x00000] in <00000000000000000000000000000000>:0 > | + | 000000000000000000000000000>:0 > Exception > feUtility::GetKeyDownString__Unmanaged > text.Exec () [0x00000] in <00000000000000000000000000000000>:0 > 例外エラー!! |
</pre> | </pre> | ||
| + | |||
| + | ログの出方から、アプリが落ちる系のログは、次回起動時に、ログが、sentryに送信してる感じがある。 | ||
2023年10月13日 (金) 14:37時点における最新版
BREAKPOINT対応
iOSのビルド設定のOtherSettingsのOptimizationのScriptCallOptimizationを、 "Slow and Safe"から"Fast but no Exceptions"にして、Exceptionをtry-catchなしで実行すると、EXC_BREAKPOINTで、クラッシュして、アプリが落ちる
Unity/負荷軽減/モバイル [ショートカット]
try-catchなしで、Exceptionを投げる例
public class ExceptionScene : MonoBehaviour
{
[SerializeField] Button button1;
void Start()
{
button1.onClick.AddListener(() =>
{
ExecException();
});
}
void ExecException()
{
throw new Exception("例外エラー!!");
}
}
以下、”Fast but no Exceptions"の設定で、Exceptionしてクラッシュした時のEXC_BREAKPOINT
extern "C" void CrashedCheckBelowForHintsWhy()
{
#if ENABLE_IOS_CRASH_REPORTING || ENABLE_CUSTOM_CRASH_REPORTER
// Make app crash hard here
__builtin_trap(); # ←ここで、"Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1093ee874)"エラーが起こった
// Just in case above doesn't work
abort();
#endif
}
sentryのログ調査
"Slow and Safe"のときのthrow new Exception()実行時は、以下がsentryログに上がる
System.Exception ExceptionScene in ExecException 例外エラー!!
"Fast but no Exceptions"のときのthrow new Exception()実行時は、アプリが落ちるが、以下がsentryログに上がる
EXC_BREAKPOINT InitCrashHandling 000000000000000000000000000>:0 > Exception > feUtility::GetKeyDownString__Unmanaged > text.Exec () [0x00000] in <00000000000000000000000000000000>:0 > 例外エラー!!
ログの出方から、アプリが落ちる系のログは、次回起動時に、ログが、sentryに送信してる感じがある。
