Native code - how to get function call stack (backtrace) programmatically

前端 未结 2 702
感情败类
感情败类 2021-02-18 13:41

I have C++ codebase running on Android, and want to have crash reports sent by users.

I\'m using ACRA library which works fine for Java code, but when something crashes

2条回答
  •  眼角桃花
    2021-02-18 14:31

    ACRA can trap the application crashing. You could then instantiate a second process that would execute the logcat ( see this question ) command, filtering by your application name, and then have the process to send the dumped file to you. This is far from optimal because:

    • The Application that would span logcat has to have the WRITE_EXTERNAL_STORAGE and READ_LOGS permissions
    • Probably the user would be annoyed to having to install a new program

    But I didn't found another alternative to do this.

提交回复
热议问题