2013年7月2日 星期二

PonyDebugger安裝記錄

https://github.com/square/PonyDebugger
安裝Server的部份跟著Readme照做就對了

iOS Client怎麼裝呢?Readme寫了一堆啦哩拉雜的,結果
pod search pony

-> PonyDebugger (0.3.0)
   Remote network and data debugging for your native iOS app using Chrome Developer Tools.
   - Homepage: https://github.com/square/PonyDebugger
   - Source:   https://github.com/square/PonyDebugger.git

   - Versions: 0.3.0, 0.2.1-beta1, 0.0.1 [master repo]

原來都有人包好了,不用客氣,Podfile裡面加入PonyDebugger,下pod update就對了。
PDDebugger *debugger = [PDDebugger defaultInstance];
[debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]];
把這三行加進AppDelegate裡面,再依想做什麼樣的debug加入其他行
現在要來做View階層的觀察,所以加入下面這兩行
[debugger enableViewHierarchyDebugging];
[debugger setDisplayedViewAttributeKeyPaths:@[@"frame", @"hidden", @"alpha", @"opaque"]];
開始Debug模式。
打開Chrome,連上http://localhost:9000/,就會看到正在運行的那個App,點進去,Oh! 開始Play吧~

沒有留言:

張貼留言