请参考以下方案:1、应用想要捕获js crash可以使用@ohos.app.ability.errorManager (ErrorManager)。ErrorManager模块提供对错误观察器的注册和注销的能力:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-app-ability-errormanager-V5可以使用faultLogger通过其查询接口进行主动获取当前的故障信息:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-faultlogger-V5hiAppEvent.addWatcher方法监听app crash:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-hiviewdfx-hiappevent-V52、参考三方库@hw-agconnect/ohos-apms:https://ohpm.openharmony.cn/\#/cn/detail/@hw-agconnect%2Fohos-apms
请参考以下方案:
1、应用想要捕获js crash可以使用@ohos.app.ability.errorManager (ErrorManager)。ErrorManager模块提供对错误观察器的注册和注销的能力:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-app-ability-errormanager-V5
可以使用faultLogger通过其查询接口进行主动获取当前的故障信息:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-faultlogger-V5
hiAppEvent.addWatcher方法监听app crash:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-hiviewdfx-hiappevent-V5
2、参考三方库@hw-agconnect/ohos-apms:https://ohpm.openharmony.cn/\#/cn/detail/@hw-agconnect%2Fohos-apms