zoukankan      html  css  js  c++  java
  • vargrind 安卓apk

    上层为安卓, 下层为调用c/c++ 库


    1、将vargind 按官网方法下载源代码编译  得Inst文件夹
    2、通过win 下安卓sdk 中 platform-tools 中的adb push Inst 到/data/local 下
    3、可把adb.exe所在文件夹 设置到系统环境变量中
    4、在cmd 中把运行adb push  Inst /data/local/
    5、adb shell 进入安卓手机环境
    5、chmod -r 777 文件夹。 更改对应文件夹权限
    chown -R root.root *

    编写脚本

    var.sh:

    #!/system/bin/sh
    VGPARAMS='--error-limit=no --leak-check=full --track-origins=yes --log-socket=192.168.1.153:12345 '
    export TMPDIR=/data/data/org.bl
    exec /data/local/Inst/bin/valgrind $VGPARAMS $*

    保存:

     当中192.168.1.153:12345 为接收将vargrind 日志重定向的IP 地址和port。(所以能够自己写个监听程序监听vargrind 的输出。 可将输出打印或者写文件)

    /data/data/org.bl 为手机上java 包的路径

    /data/local/Inst/bin/valgrind  为手机上vargrind 路径


    将var.sh 通过adb push 到 /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 包名。 ApjsuaActivity  java包的类名)


    ps 查看valgrind   程序是否启动, 若启动, 则等待3~5分钟之后界面才出现, 出现之后操作观看vargrind 输出的日志信息

  • 相关阅读:
    js中的this指针(五)
    一个链式调用 setTimeout的例子
    js中的this指针(四)
    js中的this指针(三)
    NOJ 爱过
    Greatest Greatest Common Divisor HD5207
    Greatest Greatest Common Divisor HD5207
    Greatest Greatest Common Divisor HD5207
    Greatest Greatest Common Divisor HD5207
    Four Inages Strateg
  • 原文地址:https://www.cnblogs.com/mthoutai/p/6943543.html
Copyright © 2011-2022 走看看