Reveal 介紹
Reveal 是一款運行在 Mac OS 上的應用,要調試 iOS應用,開發者要將應用程序與 Reveal 安裝的框架層關聯。Reveal 會掃描其網絡中關聯的應用程序,并讓開發者選擇連接其中之一,當連接到一個應用程序后,Reveal 將顯示其 UI,其中包括大量的參數和設置。開發人員現在可以檢查 UI 或者更改設置,直到用戶界面的外觀和行為達到預期目標。目前它尚不支持布局約束,但根據 Reveal 的支持文檔來看,這一功能將在未來的版本中發布。Reveal 可以和 iOS模擬器一起使用,也可以用在運行在真機上的應用程序上。另外,Reveal 的安裝只需幾分鐘。
除了解析出 UI 參數外,Reveal 也會通過一個分解的 3D 視圖顯示復雜的 UI 層次結構。開發者可以輕松的檢查 UI 組件的分層,并在其層次結構中選擇特定元素。為了進一步簡化調試,也可以僅關注部分 UI,而把其余部分屏蔽起來。
Reveal 的使用
-
為工程項目添加 Reveal.framework
1.打開 Reveal 工具的 Help 菜單找到 Reveal.framework 對應的路徑
「Reveal framework」對應的路徑
2.然后直接拖動他到我們的工程上,這時會彈出對話框,記得勾選「Copy items if needed」
添加 Reveal.framework
確保已經加載 Reveal.framework
3.在工程的「Build Settings」下的「Other Linker Flags」添加「Any iOS Simulator SDK」項,對應的值為「-ObjC」
修改如上
4.此時運行項目 出現錯誤如下:
Undefined symbols for architecture x86_64:
"_deflate", referenced from:
-[IBAHTTPJSONResponse initWithJSONString:compress:] in Reveal(IBAHTTPJSONResponse.o)
"_deflateEnd", referenced from:
-[IBAHTTPJSONResponse initWithJSONString:compress:] in Reveal(IBAHTTPJSONResponse.o)
"_deflateInit2_", referenced from:
-[IBAHTTPJSONResponse initWithJSONString:compress:] in Reveal(IBAHTTPJSONResponse.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
錯誤提示
這時我們需要引入 libz.tbd 庫,
引入 libz.tbd 庫