gpt4 book ai didi

ios - 我如何在 Unity3d (iOS) 上获得正确的堆栈跟踪

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:32:35 24 4
gpt4 key购买 nike

我的代码:

try
{
throw new System.ArgumentException("Parameter cannot be null", "original");
}
catch (Exception ex)
{
string exception = ex.ToString();
}

但正确的堆栈跟踪只能在 Unity 的编辑器中获取。

System.ArgumentException: Parameter cannot be null
Parameter name: original
at MyClassName (System.String message) [0x00026] in /Users/xxx/Documents/xxx/myPackageName/xxx/xxx/xxx/myClassName.cs:104

在设备堆栈跟踪是这样的:

System.ArgumentException: Parameter cannot be null
Parameter name: original
at MyClassName(System.String message) [0x00000] in <filename unknown>:0
at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <filename unknown>:0
at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
at UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke (.T1 handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, Boolean pressed, Boolean released) [0x00000] in <filename unknown>:0
at UnityEngine.EventSystems.EventSystem.Update () [0x00000] in <filename unknown>:0

为什么在 Unity 的编辑器中我在堆栈跟踪中有文件名和行号,但在这个 iOS 设备上我没有这个?

这是一个开发版本

最佳答案

在 Unity 中构建 ios 时,请在构建对话框中选中 Development Build。此外,在下拉菜单中,选择 Run in Xcode as Debug。在build设置中,关闭 strip 符号复选框。

这将在构建中包含符号,并允许报告文件名和行号。

关于ios - 我如何在 Unity3d (iOS) 上获得正确的堆栈跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39274922/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com