The upper level is Android, the lower layer is called C + + library
1, will vargind according to the official website method to download the source code compiled Inst directory 2, through the win under the Android SDK Platform-tools in the ADB push Inst to/data/local 3, the Adb.exe directory can be set to the system environment variable 4, in CMD in the execution of ADB push INST/DATA/LOCAL/5, adb shell into the Android phone Environment 5, chmod-r 777 directory, change the corresponding directory permissions chown-r Root.root *
Writing scripts
Var.sh:
#!/system/bin/shvgparams= '--error-limit=no--leak-check=full--track-origins=yes--log-socket=192.168.1.153:12345 ' Export Tmpdir=/data/data/org.blexec/data/local/inst/bin/valgrind $VGPARAMS $*
Save:
Where 192.168.1.153:12345 is to receive the Vargrind log redirected IP address and port, (so you can write a listener to listen to the output of vargrind, output can be printed or write files)
/DATA/DATA/ORG.BL the path to the Java package on the phone
/data/local/inst/bin/valgrind the Vargrind path on the phone
Push var.sh through ADB to/data/local/tmp/
chmod 777 var.sh
SetProp Wrap. ORG.BL "logwrapper/data/local/val.sh"
am start -a android.intent.action.main -n org.bl /org.bl . apjsuaactivity
(org.bl Java package name, apjsuaactivity Java Package class name )
ps view valgrind program is started, if started, wait 3-5 minutes after the interface appears, after the operation to watch the Vargrind output log information