The invention relates to the field of
software maintenance, in particular to a Native layer
crash tracing method and apparatus for an Android
system, a storage medium and a terminal. The method comprises the steps of capturing a
signal event of Native layer
crash of an application, and detecting whether the
signal event is registered by the application or not; if the
signal event is registered bythe application, calling a
processing function corresponding to the signal event and preset by an application process, and executing the
processing function: calling a function interface of a
Java layer in a Native layer, and obtaining a JNIEnv variable of a thread receiving the signal event; calling a FindClass function through the JNIEnv variable to obtain
Java classes; reflectively calling a getStackTrace function to obtain
call stack information of the
Java classes, thereby obtaining all information of a
call stack of the whole Java layer; and according to all the information of the
call stack of the whole Java layer, tracing reasons for the Native layer
crash. The problem that the reasons for the Native layer crash in the Android
system cannot be traced well at present is solved.