Lookin 可以查看与修改 iOS App 里的 UI 对象,类似于 Xcode 自带的 UI Inspector 工具,或另一款叫做 Reveal 的软件。当我们需要了解老项目时,它是一款高效率的UI调试神器,Lookin是完全免费的。
优点
1.控制台随时访问 iOS App 里的任意 NSObject 的属性或方法;
2.Lookin Mac版可以显示变量名,以及 indexPath 等各种提示;
3.选择 App 时,也可一眼找到你要的那个应用;
4.可以监听某个类的某个方法,此方法调用时软件会打印堆栈信息;
5.可以查看2维,3维等视图层级;
使用 CocoaPods
1.下载Mac Lookin;
2.在Mac上安装Lookin应用;

3.在需要调试的项目中添加 pod 'LookinServer', :configurations => ['Debug'];
4.打开Lookin

5.在执行pod 后运行项目,第一次运行比较缓慢请耐心等待

6.双击打开上面的窗口,可以查看大图

7.愉快的开始我们的调试之路吧!
手动导入
1.从Github下载LookinServer 源代下载地址:https://github.com/QMUI/LookinServer
2.将SourceCode文件夹移动到你的 iOS 项目文件夹里。


-
打开你的 iOS 项目,把 Lookin.xcodeproj 文件从 Finder 拖到你的 xcodeproj 下面,即把 Lookin 作为你的 iOS 主工程的子工程。
截屏2021-05-12 下午5.29.29.png
-
选择你的 iOS target,在右侧 General 面板下找到 “Frameworks, Libraries, and Embedded Content” 这一栏,点击添加,然后在弹出的面板中找到 LookinServer.framework,点击 “Add” 确认添加。
image

-
把 LookinServer.framework 设置为 “Embed & Sign”
image
6.重新编译运行你的 app,Lookin 应该已经可以正常工作了。

网友评论