「Unity/fabricのcrashlytics」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→強制的にクラッシュ) |
|||
| 行1: | 行1: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==強制的にクラッシュ== | ==強制的にクラッシュ== | ||
参考:https://firebase.google.com/docs/crashlytics/force-a-crash?authuser=0&platform=unity | 参考:https://firebase.google.com/docs/crashlytics/force-a-crash?authuser=0&platform=unity | ||
| 行71: | 行40: | ||
</pre> | </pre> | ||
| − | firebaseのlogに載った | + | ===firebaseのlogに載った=== |
| + | androidでは掲載できた。iosではアプリが途中で止まり、ログは出なかった・・。 | ||
<pre> | <pre> | ||
Non-fatal Exception: java.lang.Exception | Non-fatal Exception: java.lang.Exception | ||
| 行77: | 行47: | ||
TitleScript.throwExceptionEvery60Updates (TitleScript) | TitleScript.throwExceptionEvery60Updates (TitleScript) | ||
TitleScript.Update (TitleScript) | TitleScript.Update (TitleScript) | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
</pre> | </pre> | ||
2019年6月10日 (月) 01:36時点における版
強制的にクラッシュ
参考:https://firebase.google.com/docs/crashlytics/force-a-crash?authuser=0&platform=unity
public class TitleScript : MonoBehaviour {
int updatesBeforeException;
// Use this for initialization
void Start () {
updatesBeforeException = 0;
}
// Update is called once per frame
void Update()
{
// Call the exception-throwing method here so that it's run
// every frame update
throwExceptionEvery60Updates();
}
// A method that tests your Crashlytics implementation by throwing an
// exception every 60 frame updates. You should see non-fatal errors in the
// Firebase console a few minutes after running your app with this method.
void throwExceptionEvery60Updates()
{
if (updatesBeforeException > 0)
{
updatesBeforeException--;
}
else
{
// Set the counter to 60 updates
updatesBeforeException = 60;
// Throw an exception to test your Crashlytics implementation
throw new System.Exception("test exception please ignore");
}
}
}
firebaseのlogに載った
androidでは掲載できた。iosではアプリが途中で止まり、ログは出なかった・・。
Non-fatal Exception: java.lang.Exception
Exception : test exception please ignore
TitleScript.throwExceptionEvery60Updates (TitleScript)
TitleScript.Update (TitleScript)
