zoukankan      html  css  js  c++  java
  • iOS 测试工具reveal可视化调试工具的使用

    简单翻译一下reveal可视化图形工具插入项目的官方文档(官方英文版file:///Applications/Reveal.app/Contents/SharedSupport/Documentation/Load%20Reveal%20Without%20Changing%20Your%20Xcode%20Project.html)

    官方有好几种方法,这里主要推荐两种方法。

    一.打断点(此方法只对模拟器有效果,真机请看方法二)

    01-打开项目之后,来到打断点界面。Add Symbolic Breakpoint.

    02-edit-Breakpoint中输入一下信息

    UIApplicationMain

    Add Action button----》Debugger Command

    expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 0x2) : ((void*)0)

    03-在断点右击---》选User

    04-运行项目,在模拟器的项目就可以在Reveal中看到了。此断点在一个项目完成设置之后,在另一个项目也可以生效,并不需要每个项目都设置一次。

    二.导入frame法(真机和模拟器都有效)

    本方法只对进行过设置的项目才有效,有就是说每个项目需要设置一次,因为是在真机运行,而且模拟器运行的也是每个项目需设置一次。

    (官方说明:file:///Applications/Reveal.app/Contents/SharedSupport/Documentation/Integrating%20Reveal%20Linking.html)

    01-启动Reveal并打开library目录

    02-将RevealServer.framework复制到项目的根目录,特别提醒:在拖到这个文件的时候记得按着option键拖到,不然只是一个引用,编译的时候会出错,打开项目。

    03-选中项目target --- 》Build Settings----》搜索Framework Search Paths---》将$(inherited) $(SRCROOT)填进去

    04-Build Settings---->Other Linker Flags--->填入-ObjC -weak_framework RevealServer

    05-Build Settings---->Runpath Search Paths--->填入$(inherited) @executable_path/Frameworks,我的项目本身就填有这个,略过了。

    06-Build Phases --》点击+添加Run Script phase

    复制下面的内容到描述里

     export REVEAL_SERVER_FILENAME="RevealServer.framework"
    
     # Update this path to point to the location of RevealServer.framework in your project.
     export REVEAL_SERVER_PATH="${SRCROOT}/${REVEAL_SERVER_FILENAME}"
    
     # If configuration is not Debug, skip this script.
     [ "${CONFIGURATION}" != "Debug" ] && exit 0
    
     # If RevealServer.framework exists at the specified path, run code signing script.
     if [ -d "${REVEAL_SERVER_PATH}" ]; then
       "${REVEAL_SERVER_PATH}/Scripts/copy_and_codesign_revealserver.sh"
     else
       echo "Cannot find RevealServer.framework, so Reveal Server will not be started for your app."
     fi

    07-打开项目,运行,就可以在reveal中看到项目了,亲测成功。

    
    
    
  • 相关阅读:
    linux(13)-如何创建软链接?
    linux(12)-如何操作允许root用户远程登录
    性能测试监控分析(14)-linux环境下性能监控命令dstat
    Codeforces Round #585 (Div. 2)E(状态压缩DP,思维)
    Codeforces Round #584
    【PAT甲级】1034 Head of a Gang (30 分)
    Educational Codeforces Round 72 (Rated for Div. 2)E(线段树,思维)
    【PAT甲级】1033 To Fill or Not to Fill (25 分)(贪心,思维可以做出简单解)
    【PAT甲级】1032 Sharing (25 分)
    【PAT甲级】1031 Hello World for U (20 分)
  • 原文地址:https://www.cnblogs.com/somethingWithiOS/p/6594496.html
Copyright © 2011-2022 走看看