我如何与Android应用程序运行的valgrind? [英] How do I run valgrind with an Android app?
问题描述
我已经为Android安装Valgrind的,我可以证实,它正在为我试着用它运行LS,并能正常工作。
I've installed valgrind for android and I can confirm it is working as I tried running ls with it, and it works fine.
但我怎么执行与本机组件一个Android应用程序,我想调试?我看了看这个问题:如何下手的valgrind一个Android应用程序一>,但我不知道如何遵循它。你如何包装在一个shell脚本的应用程序?什么是包装。其次应该是包的名字?
But how do I execute an android app with a native component I would like to debug? I looked at this question: How to start an android app with valgrind but I have no idea how to follow it. How do you wrap an app in a shell script? What is "wrap." followed by the package name supposed to be?
我试着这样做与com.matthewmitchell.wakeifyplus是我的应用程序包:
I tried doing this with com.matthewmitchell.wakeifyplus being my application package:
setprop wrap.com.matthewmitchell.wakeifyplus "logwrapper /data/local/valgrind"
但它说:无法设置属性。我应该做些什么?我找不到一步的指导,工程的任何步骤。我也试试这个(我甚至不知道什么setprop一样):
but it says "could not set property". What am I supposed to do? I can't find any step by step guide that works. I did try this (I don't even know what setprop does):
setprop com.matthewmitchell.wakeifyplus "logwrapper /data/local/valgrind"
使用/数据/本地/ Valgrind的是一个shell脚本执行权限是:
With /data/local/valgrind being a shell script with execute permissions which is:
#!/system/bin/sh
VGPARAMS='--error-limit=no'
export TMPDIR=/data/data/com.matthewmitchell.wakeifyplus
exec /data/local/Inst/bin/valgrind $VGPARAMS $*
但是当我运行的应用程序:
But when I run the app with:
am start -a android.intent.action.MAIN -n com.matthewmitchell.wakeifyplus/.MainActivity
的valgrind不会在logcat中显示出来,即使清理后。
valgrind does not show up in logcat, even after clearing it.
推荐答案
您得到错误无法设置属性,因为您不能设置属性名的长度大于31 ,这是在属性名的数量最大允许的字符: http://stackoverflow.com/a/5068818/313113
You get the error "could not set property" because you CANNOT set a property name with a length greater than 31, which is the number maximum allowed characters in the property name: http://stackoverflow.com/a/5068818/313113
尽量减少当您设置与亚行的shell setprop财产少于或等于31个字符的包名称的长度。
和使用bash脚本简单的事情。
欲了解更多详情,请参阅我的答案在这里: http://stackoverflow.com/a/19235439/313113
Try to reduce the package name length to less than or equal 31 characters when you set the property with adb shell setprop.
And use a bash script to simply things.
For further details see my answer here: http://stackoverflow.com/a/19235439/313113
这篇关于我如何与Android应用程序运行的valgrind?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!