美文网首页
Reveal的使用

Reveal的使用

作者: OneAlon | 来源:发表于2017-06-09 17:04 被阅读80次

    iOS应用开发中,可以使用Reveal查看视图的层级以及修改视图的属性(虽然xcode自带的工具也可以查看,但是功能却没有Reveal强大),还可以使用越狱手机查看其它应用的结构等.

    提供一个Reveal的下载地址:Reveal

    模拟器调试

    • 1.在XCode中选择ViewNavigatorsShow Breakpoint Navigator.
    • 2.添加Symbolic Breakpoint
    • 3.Symbol中填入UIApplicationMain
    • 4.选择Add Action按钮
    • 5.填入下列内容
    expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 0x2) : ((void*)0)
    
    • 6.勾选Automatically continue after evaluating actions
    BreakPoint
    • 7.右键选择断点,选择Move Breakpoint ToUser
    • 8.在XCode中运行程序

    #### 真机调试(未越狱)

    • 1.查找RevealServer.framework所在位置,在RevealHelpShow Reveal Library in Finder
    RevealServer.framework
    • 2.将RevealServer.framework拷贝到项目的根目录中
    • 3.使用XCode打开项目,选择要操作的TARGETS
    image.png
    • 4.选择Build Settings,在Framework Search PathsDebug模式下设置:
    $(inherited) $(SRCROOT)
    
    Framework Search Paths
    • 5.选择Build Settings,在Runpath Search PathsDebug模式下设置:
    $(inherited) @executable_path/Frameworks
    
    • 6.选择Build Phases,添加Run Script
    Run Script
    • 7.在Run Script添加如下代码
    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
    
    • 8.在Debug模式下运行项目
      Reveal.png

    相关文章

      网友评论

          本文标题:Reveal的使用

          本文链接:https://www.haomeiwen.com/subject/lvwxqxtx.html