1. 程式人生 > >IOS Xcode -> instruments -> Leaks

IOS Xcode -> instruments -> Leaks

創建 ons 一段時間 虛擬機 phone detail oca 檢測 cat

1. 創建 project

2. 加載 source code

3. 連接 iphone 或 虛擬機,選擇 app

4. 打開 Xcode -> Open Developer Tool -> Instruments

3.1 打開 allocations (頁面包含: Allocations, VM Tracker)

3.2 右邊 “+”,選擇 Leaks

5. 打開頁面,停留一段時間,等圖上出現 綠色、紅色或灰色 符號,再測試下一個頁面

6. 點擊圖上的紅色符合,details ,選擇“cycles & Roots”,點擊右邊 Strack Trace, 及左邊的方法,定位到具體的 code

7. 排查後,檢測代碼

IOS Xcode -> instruments -> Leaks