(Lookin) iOS开发UI调试工具Lookin
2022-06-08 本文已影响0人
布呐呐u
一个开源免费的
UI
调试软件
使用方法
- CocoaPods
pod 'LookinServer', :configurations => ['Debug']
- Package Manager
https://github.com/QMUI/LookinServer
- 手动导入
- 下载
LookinServer.framework
- 将
LookinServer.framework
拷贝到iOS
工程根目录- 选中
Target
,导航至Build Settings
选项卡,找到Framework Search Paths
,在Debug
选项卡中新增$(SRCROOT)
- 选中
Target
,导航至Build Settings
选项卡,找到Other Linker Flags
,在Debug
选项卡中新增-ObjC -weak_framework LookinServer
- 选中
Target
,导航至Build Phases
选项卡,点击左上角+
号,新建脚本New Run Script Phase
,将如下内容拷贝脚本中- 重新运行,即可呈现
- 脚本内容
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