iOS的網絡調試庫:netfox

jopen 9年前發布 | 14K 次閱讀 netfox iOS開發 移動開發

iOS的網絡調試庫:netfox

一個輕量級,一行代碼安裝,網絡調試庫。可以快速查看由您的應用程序執行的所有執行網絡請求。它收集了所有的請求 - 包括從第三方庫(如AFNetworking,UIWebViews等的請求。

非常方便和實用的網絡相關的問題和錯誤。

Implemented in Swift 2.1 - bridged also for Objective-C

Feel free to contribute :)

Overview

iOS的網絡調試庫:netfox

Installation

Copy the “nfx” folder in your project (make sure that “Create groups” option is selected) and add the following line in didFinishLaunchingWithOptions: method of your AppDelegate

Swift

NFX.sharedInstance().start()

Objective-C

[[NFX sharedInstance] start];

Just simple as that!

Note: Please wrap the above line with

#if DEBUG
. . .
#endif

to prevent library’s execution on your production app.

You can add the DEBUG symbol with the -DDEBUG entry. Set it in the “Swift Compiler - Custom Flags” section -> “Other Swift Flags” line in project’s “Build Settings”

Pod

On the way.. :)

Usage

Just shake your device and check what's going right or wrong! Shake again and go back to your app! fact iOS的網絡調試庫:netfox

Custom gestures

By default the library registers for shake motion. If you want to open the logs with a different gesture, add the following line after the installation one

NFX.sharedInstance().setGesture(.custom)

Then you can use

NFX.sharedInstance().show()

when you want to show the logs and

NFX.sharedInstance().hide()

when you want to hide them.

Features

  • Search: You can easily search among requests via
    • Request url: github.com, .gr, or whatever you want
    • Request method: GET, POST, etc
    • Response type: Like json, xml, html, image and more
  • Sharing: You can share your log via email with backend devs or someone who can help.
    • Simple log option includes only request/response headers and small request/response bodies (when applicable)
    • Full log option includes request/response headers and request/response bodies (as attachments)
  • More to come.. ;)

項目主頁:http://www.baiduhome.net/lib/view/home/1448372967704

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!