开发者

Debugging Android native applications built with vs-android

I am using vs-android for building native C++ Android applications. I would like to debug from the command line by launching gdbserver on the emulator and connecting to that GDB server. Since I'm not using the Android build scripts I don't get the gdbserver delivered by default. So I added gdbserver to the lib folder from where vs-android collects 开发者_开发百科it and pushes it into the APK. The file is now found on the emulator in the lib folder of the application where my SO is also located when I deploy the application with adb install.

I now try to run gdbserver with run-as but I get the error "Cannot attach to process 924: Operation not permitted (1)".

According to this http://ian-ni-lewis.blogspot.com/2011/05/ndk-debugging-without-root-access.html the server should be able to attach to the process when gdbserver is started with run-as.

Any ideas as to what I could still be doing wrong?


adb shell su -c setenforce 0 it will solve the problem


To figure out if the problem is with run-as or with gdbserver, try using run-as to execute 'ps' instead of gdbserver, and then see if the 'ps' process is listed as having the same userid as the application's process. If not, you have a problem with run-as. If it is the same userid as the app, then the problem is more likely with gdbserver.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜