美文网首页
(Lookin) iOS开发UI调试工具Lookin

(Lookin) iOS开发UI调试工具Lookin

作者: 布呐呐u | 来源:发表于2022-06-08 20:52 被阅读0次

    一个开源免费的UI调试软件

    使用方法

    • CocoaPods
    pod 'LookinServer', :configurations => ['Debug']
    
    • Package Manager
    https://github.com/QMUI/LookinServer
    
    • 手动导入
    1. 下载LookinServer.framework
    2. LookinServer.framework拷贝到iOS工程根目录
    3. 选中Target,导航至Build Settings选项卡,找到Framework Search Paths,在Debug选项卡中新增 $(SRCROOT)
    4. 选中Target,导航至Build Settings选项卡,找到Other Linker Flags,在Debug选项卡中新增 -ObjC -weak_framework LookinServer
    5. 选中Target,导航至Build Phases选项卡,点击左上角 号,新建脚本New Run Script Phase,将如下内容拷贝脚本中
    6. 重新运行,即可呈现
    • 脚本内容
    FRAMEWORK_FILENAME="LookinServer.framework"
    FRAMEWORK_WORKPATH="${CODESIGNING_FOLDER_PATH}/Frameworks"
    
    # Define that LookinServer.framework is at the root directory of your Xcode project. If you want to move LookinServer.framework to a subdirectory named "FavoriteFrameworks", replace the line below with 'FRAMEWORK_PATH="${SRCROOT}/FavoriteFrameworks/${FRAMEWORK_FILENAME}"', and add "$(SRCROOT)/FavoriteFrameworks" to "Framework Search Paths" in "Build Settings" tab. 
    # 定义当前 LookinServer.framework 的文件位置位于项目根目录。请确保你确实已经把文件复制到了项目根目录(即和 .xcodeproj 文件处于同一个文件夹内)。如果你希望把 LookinServer.framework 放置到别的地方,比如项目根目录下一个叫 “FavoriteFrameworks” 的文件夹内,则请把下面这句改成 FRAMEWORK_PATH="${SRCROOT}/FavoriteFrameworks/${FRAMEWORK_FILENAME}",同时在 Build Settings 的 Framework Search Paths 里增加 “$(SRCROOT)/FavoriteFrameworks” 
    FRAMEWORK_PATH="${SRCROOT}/${FRAMEWORK_FILENAME}"
    
    # If configuration is not "Debug", do not integrate LookinServer.framework
    # 如果当前不是 Debug 模式则不植入 LookinServer.framework
    [ "${CONFIGURATION}" != "Debug" ] && exit 0
    
    # If you want to use Lookin both in "Debug" and another configuration(e.g. "DailyTest"), comment the line above and uncomment the line below. Be careful not to integrate LookinServer in "Release" configuration.
    # 如果你想同时在 Debug 模式和一个你自定义的叫 "DailyTest" 的模式下使用 Lookin,则请注释掉上面那句,同时解开下面这句的注释。再次提醒不要在 Release 模式下植入 LookinServer。
    # [ "${CONFIGURATION}" != "Debug" ] && [ "${CONFIGURATION}" != "DailyTest" ] && exit 0
    
    mkdir -p "${FRAMEWORK_WORKPATH}"
    
    if [ -e "${FRAMEWORK_PATH}" ]; then
        cp -Rf "$FRAMEWORK_PATH" "${FRAMEWORK_WORKPATH}"
        if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then
            codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${FRAMEWORK_WORKPATH}/${FRAMEWORK_FILENAME}"
        fi
        echo "LookinServer was integrated successfully."
    else
        echo "Failed to integrate LookinServer. Because the framework could not be found at ${FRAMEWORK_PATH}."
    fi
    
    

    相关文章

      网友评论

          本文标题:(Lookin) iOS开发UI调试工具Lookin

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