A lightweight, one line setup, iOS / OSX network debugging library! 🦊

Overview

Netfox: A lightweight, one line setup, network debugging library

Version CI Status Cocoapods Compatible Carthage Compatible Platform License

Netfox provides a quick look on all executed network requests performed by your iOS or OSX app. It grabs all requests - of course yours, requests from 3rd party libraries (such as AFNetworking, Alamofire or else), UIWebViews, and more

Very useful and handy for network related issues and bugs

Supports Swift 4 and above - bridged also for Objective-C.

For Swift 3.2 support, use version 1.12.1.

Feel free to contribute :)

Overview

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. To integrate netfox into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!
pod 'netfox'

To bundle only on some build configurations specify them after pod.

use_frameworks!
pod 'netfox', :configurations => ['Debug', 'Test']

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate netfox into your Xcode project using Carthage, specify it in your Cartfile:

github "kasketis/netfox"

Manually

If you prefer not to use dependency managers, you can integrate netfox into your project manually.

You can do it by copying the "netfox" folder in your project (make sure that "Create groups" option is selected)

The above folder contains 3 subfolders: Core, iOS and OSX.

  • If you target on iOS keep only Core and iOS folders (remove OSX folder)
  • If you target on OSX keep only Core and OSX folders (remove iOS folder)

Start

Swift

// AppDelegate
import netfox
NFX.sharedInstance().start() // in didFinishLaunchingWithOptions:

Objective-C

// AppDelegate
[NFX.sharedInstance start]; // in didFinishLaunchingWithOptions:

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"

Usage

Just shake your device and check what's going right or wrong! Shake again and go back to your app!

Stop

Call

NFX.sharedInstance().stop()

to stop netfox and clear all saved data. If you stop netfox its view will not be displayed until you call start method again.

If you want to just enable/disable logging functionality or clear the data please use the buttons provided in the settings view

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.

Prevent logging for specific URLs

Use the following method to prevent requests for specified URL from being logged. You can ignore as many URLs as you want

NFX.sharedInstance().ignoreURL("the_url")

Tip: You can use the url of the host (for example "https://www.github.com") to ignore all paths of it

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)
  • Filtering: Select what types of responses (JSON/XML/HTML/Image/Other) you want to see
  • Enable/disable logging within the app
  • Clear data within the app
  • Statistics: Check cool things like average response time, total response size and more for your selected types of responses
  • Info: Check your IP address, your app version and build number and other things within the app
  • More to come.. ;)

Integrations

Droar: A modular, single-line installation debugging window.

Other

  • If you experience any problems with request logging please check this. If you don't get your answer please open an issue
  • Due to the large size of request/response bodies, the library provides disk storage for low memory overhead

Thanks

Special thanks to tbaranes and vincedev for their contribution on OSX library!

Licence

All source code is licensed under MIT License. Which means you could do virtually anything with the code. I will appreciate it very much if you keep an attribution where appropriate.

Comments
  • OSX Support

    OSX Support

    It takes a bit more time than expected (not enough free time), but here it is: OS X support! #42

    All the features has been copy from iOS, just missing:

    • Sharing by email: not sure if that necessary since the text can be selected / copy
    • README update
    • Git history improvements (squashed all the commits?)

    We test the OS X version in our project these last days , it was working well. So, I think, it would be ok, but maybe iOS needs to be tested again (since, we moved a lot stuff).

    From now on, I'm waiting your feedback on:

    • Interfaces
    • Code architecture / conception => If you want make some change, just ask!

    Hope you will like it :)

    screen shot 2016-02-08 at 18 18 38 screen shot 2016-02-08 at 18 18 43 screen shot 2016-02-08 at 18 18 49 screen shot 2016-02-08 at 18 18 55 screen shot 2016-02-08 at 18 18 32 screen shot 2016-02-08 at 18 18 26

    opened by tbaranes 19
  • Carthage support

    Carthage support

    Hi, Very good work.

    Could you please share your schema to support carthage installation?

    https://github.com/Carthage/Carthage/blob/master/README.md#supporting-carthage-for-your-framework

    THX

    enhancement 
    opened by z4r 15
  • Integration with Alamofire in iOS 9 causes RTO

    Integration with Alamofire in iOS 9 causes RTO

    The title says it all. I tried to configure Netfox 1.11.1 with Alamofire 4.6.0 using the workarounds here, with exception of NSURLSessionConfiguration's change from defaultSessionConfiguration() to default in Swift 4.

    This issue is not apparent when I try it in iOS 9 and higher, or when I didn't call the NFX.sharedInstance().start in iOS 9. The issue still persist when I tried newer version of Alamofire.

    Does anyone have this issue too? Any help would be appreciated! 😁

    waiting 
    opened by edopelawi 13
  • OSX support

    OSX support

    Starting a first suggestion in #28 for OSX support, you seemed to be interested in it. Is there any work started yet? If no, would you be interested in a PR to handle it? (if I have the time to work on it...) Or just some helps?

    We are really interested on this since we already using Netfox in our iOS application :)

    opened by tbaranes 13
  • UIWebView does not behave as expected when netfox is enabled.

    UIWebView does not behave as expected when netfox is enabled.

    We are using a third party payment gateway. Some of the tasks (like entering credit card ) are done in a webview. When netfox was enabled website was not behaving properly (Mostly probably because javascript were not loaded properly).

    bug 
    opened by 2ank3th 12
  • Proper casing in project naming

    Proper casing in project naming

    I've noticed that this is the only framework that I use that has the framework name lowercased. @kasketis - Was this intentional? Do you mind if we update it to Netfox instead of netfox?

    enhancement 
    opened by michaelfransen 10
  • Netfox & Parse: can't see my Parse requests

    Netfox & Parse: can't see my Parse requests

    Not sure what could be the reason for that... Any idea? I see other requests (such ax Mixpanel and Facebook graph) but not Parse ones.

    But beside it - great idea and really really great and cool implematation!

    Thanks a lot!!

    opened by oferRounds 9
  • Exporting as HAR file

    Exporting as HAR file

    Looking in the email, I received the following under the request section:

    -- Body --
    
    Too long to show. If you want to see it, please tap the following button
    

    We should maybe let exporting show the full body :)

    enhancement 
    opened by Janglinator 8
  • Using Netfox without modal presentation

    Using Netfox without modal presentation

    I've created a project where I having a large selection of debugging tools built into one debugging window. Netfox is spectacular, and I'd like to add it as another section of the pod. However I don't wish to present it modally, but rather push it onto my existing navigation controller. Is there any way we could publicly expose the NFXListController class for custom usage?

    P.S. my library is in ObjC, so an @objc at the top would also be awesome!

    enhancement 
    opened by Janglinator 8
  • KFSwiftImageLoader

    KFSwiftImageLoader

    Great tool!

    Would you expect this to work with https://github.com/kiavashfaisali/KFSwiftImageLoader ?

    I'm able to see other request/responses in netfox, except for those...

    bug 
    opened by ghost 8
  • Sponsorship / Donation

    Sponsorship / Donation

    Hello, The company I work for is organizing a donation wave to support projects/teams that are doing a tremendous job helping out the open source community. Netfox it's one of these, no doubt.

    Are you open for donations/sponsorship?

    Regards.

    opened by GuilhE 7
  • By default don't print to the console and add a configuration option to set it to enabled.

    By default don't print to the console and add a configuration option to set it to enabled.

    The Problem

    Netfox pollutes the console with file not found error message for responses whose bodies aren't saved to the file system.

    Solution

    By adding configuration to enable and disable the console printing.

    opened by jz709u 0
  • Not able to search something in request or response

    Not able to search something in request or response

    Is your feature request related to a problem? Please describe. I'm not able to search in request or response, Most of the time in real world scenarios, we deal with very large network responses, and let's say we're getting some wrong data, and we want to debug that, we may know the key name, or we can try to search the incorrect value in response itself, since response is long, it's not feasible to scroll and check it line by line. Currently either have to copy the curl, run it in postman and search it there or copy the response, paste it in some text editor and search there which is very frustrating

    Describe the solution you'd like There should be a search option(atleast to response) to search something in api response

    enhancement 
    opened by PM74367 0
  • [Bug] Curls with request body don't work in postman

    [Bug] Curls with request body don't work in postman

    Describe the bug Imported curls don't work in postman when request body is present

    To Reproduce Import curl for request which contains some body Sample curl: curl "https://collector.github.com/github/collect" -X POST -H "Cache-Control: max-age=0" -H "Accept: /" -H "Origin: https://github.com" -H "Referer: https://github.com/kasketis/netfox" -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" -H "Content-Type: application/json" -d "{"body":"abc"}" Import curl in postman and try to hit, it don't work, if you go to body section of request, it shows invalid body(attached ss of body) If we change double quote in curl in data to single quote, it works fine

    Expected behavior Imported curl should work properly without any modification

    Screenshots/Video Screenshot 2022-09-10 at 12 15 13

    Enviroment: Reproducable on every environment I tried on Netfox version 1.21.0 Postman version 9.13.0

    bug 
    opened by PM74367 0
  • Any method to show specific URL request Only like ignoreURL ignore specific URL?

    Any method to show specific URL request Only like ignoreURL ignore specific URL?

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    enhancement 
    opened by DipeshCoutloot 0
  • Can't see requests with Moya and Netfox version more than 1.20.0

    Can't see requests with Moya and Netfox version more than 1.20.0

    Describe the bug Can't see request with Moya and Netfox version > 1.20.0

    To Reproduce Steps to reproduce the behavior:

    1. Need use Moya and Swift 5.5
    2. Need install from pod Netfox version more > 1.20.0
    3. Enable debug mode
    4. Shake simulator or real device

    Expected behavior When we using Netfox version 1.19.0 and Moya all good!

    Enviroment:

    • Device: iOS
    • OS: 14.5, 15.0
    • Netfox version: 1.20.0 >
    • Xcode version: 13.0.
    • Swift version: 5.5
    bug 
    opened by AntonBrock 0
Releases(1.21.0)
  • 1.21.0(Mar 27, 2022)

    What's Changed

    • Added method to get session log data by @skychiarottoa in https://github.com/kasketis/netfox/pull/198
    • Fix memory leaks by invalidating session after cancelling tasks by @pauluhn in https://github.com/kasketis/netfox/pull/209
    • Refactored file storing. Other minor refactoring by @vGubriienko in https://github.com/kasketis/netfox/pull/222
    • Fixed curl export format + Embed netfox framework into demo project to run on a real device by @vGubriienko in https://github.com/kasketis/netfox/pull/225
    • Refactoring UI part by @vGubriienko in https://github.com/kasketis/netfox/pull/224
    • Fixed UI issues by @vGubriienko in https://github.com/kasketis/netfox/pull/226
    • Fixed crash when URLSessionWebSocketTask used by @vGubriienko in https://github.com/kasketis/netfox/pull/227
    • Updated logo by @vGubriienko in https://github.com/kasketis/netfox/pull/229
    • Fixed issue with macos version by @vGubriienko in https://github.com/kasketis/netfox/pull/231

    New Contributors

    • @skychiarottoa made their first contribution in https://github.com/kasketis/netfox/pull/198
    • @pauluhn made their first contribution in https://github.com/kasketis/netfox/pull/209

    Full Changelog: https://github.com/kasketis/netfox/compare/1.20.0...1.21.0

    Source code(tar.gz)
    Source code(zip)
  • 1.20.0(Dec 9, 2021)

    What's Changed

    • refactor(common): Fix indentations / Delete redundant selfs & functions by @cci-emciftci in https://github.com/kasketis/netfox/pull/169
    • make it work if embed in another pod by @tanpengsccd in https://github.com/kasketis/netfox/pull/187
    • Long press to copy request/response fail in NFXDetailsController_iOS by @bd-jhunter in https://github.com/kasketis/netfox/pull/202
    • Finishing SPM support by @vGubriienko in https://github.com/kasketis/netfox/pull/216
    • Regex ignore url support by @vGubriienko in https://github.com/kasketis/netfox/pull/217
    • Refactor, SPM support and exclude URLs based on a regex by @vGubriienko in https://github.com/kasketis/netfox/pull/220

    New Contributors

    • @cci-emciftci made their first contribution in https://github.com/kasketis/netfox/pull/169
    • @tanpengsccd made their first contribution in https://github.com/kasketis/netfox/pull/187
    • @bd-jhunter made their first contribution in https://github.com/kasketis/netfox/pull/202
    • @vGubriienko made their first contribution in https://github.com/kasketis/netfox/pull/216

    Full Changelog: https://github.com/kasketis/netfox/compare/1.19.0...1.20.0

    Source code(tar.gz)
    Source code(zip)
  • 1.19.0(Feb 11, 2020)

    What's Changed

    • add URLSessionConfiguration.ephemeral swizzling by @michaelversus in https://github.com/kasketis/netfox/pull/193

    New Contributors

    • @michaelversus made their first contribution in https://github.com/kasketis/netfox/pull/193

    Full Changelog: https://github.com/kasketis/netfox/compare/1.18.0...1.19.0

    Source code(tar.gz)
    Source code(zip)
  • 1.16.0(Jul 22, 2019)

    What's Changed

    • Add view controller for viewing query string params (if any) upon cli… by @tzatzosm in https://github.com/kasketis/netfox/pull/165

    New Contributors

    • @tzatzosm made their first contribution in https://github.com/kasketis/netfox/pull/165

    Full Changelog: https://github.com/kasketis/netfox/compare/1.15.1...1.16.0

    Source code(tar.gz)
    Source code(zip)
  • 1.12.1(Sep 14, 2018)

  • 1.10.3(Oct 18, 2017)

    What's Changed

    • Added an iOS demo by @Janglinator in https://github.com/kasketis/netfox/pull/93
    • True one-line installation using Swizzling by @Janglinator in https://github.com/kasketis/netfox/pull/94
    • Fix various Xcode 9 issues not allowing compilation by @freak4pc in https://github.com/kasketis/netfox/pull/99

    Full Changelog: https://github.com/kasketis/netfox/compare/1.10.2...1.10.3

    Source code(tar.gz)
    Source code(zip)
  • 1.10.2(Oct 14, 2017)

  • 1.10.1(Oct 13, 2017)

    What's Changed

    • Fix macOS podspec by @tbaranes in https://github.com/kasketis/netfox/pull/72
    • [swift3] Fixed crash due force unwrap of wrong dictionary type by @adelinofaria in https://github.com/kasketis/netfox/pull/77
    • Updated the workaround to Swift 3 by @Abeansits in https://github.com/kasketis/netfox/pull/81
    • fixes downcast warning in swift 3 by @twobitlabs in https://github.com/kasketis/netfox/pull/86
    • Support JSON API headers (application/vnd.api+json) by @freak4pc in https://github.com/kasketis/netfox/pull/89
    • Added long press gesture to copy debug texts. by @freak4pc in https://github.com/kasketis/netfox/pull/90
    • Animated transfer between Info Views + Swipe gestures by @freak4pc in https://github.com/kasketis/netfox/pull/91
    • Added left close button in NFXListController_iOS + NFX.toggle() by @freak4pc in https://github.com/kasketis/netfox/pull/92

    New Contributors

    • @tbaranes made their first contribution in https://github.com/kasketis/netfox/pull/72
    • @Abeansits made their first contribution in https://github.com/kasketis/netfox/pull/81

    Full Changelog: https://github.com/kasketis/netfox/compare/1.7.2...1.10.1

    Source code(tar.gz)
    Source code(zip)
  • 1.9(Oct 12, 2017)

    What's Changed

    • Fix macOS podspec by @tbaranes in https://github.com/kasketis/netfox/pull/72
    • [swift3] Fixed crash due force unwrap of wrong dictionary type by @adelinofaria in https://github.com/kasketis/netfox/pull/77

    New Contributors

    • @tbaranes made their first contribution in https://github.com/kasketis/netfox/pull/72

    Full Changelog: https://github.com/kasketis/netfox/compare/1.7.2...1.9

    Source code(tar.gz)
    Source code(zip)
  • 1.8(Jun 27, 2016)

  • 1.7.2(Jan 18, 2016)

  • 1.7.1(Jan 8, 2016)

  • 1.7(Dec 1, 2015)

  • 1.6(Dec 1, 2015)

  • 1.5.5(Nov 30, 2015)

  • 1.5.4(Nov 30, 2015)

  • 1.5.3(Nov 30, 2015)

  • 1.5.1(Nov 30, 2015)

  • 1.5(Nov 29, 2015)

  • 1.4.2(Nov 29, 2015)

  • 1.4.1(Nov 28, 2015)

  • 1.4(Nov 28, 2015)

  • 1.3.4(Nov 28, 2015)

  • 1.3.3(Nov 28, 2015)

  • 1.3.2(Nov 27, 2015)

  • 1.3.1(Nov 27, 2015)

  • 1.3(Nov 27, 2015)

  • 1.2.1(Nov 27, 2015)

  • 1.2(Nov 26, 2015)

  • 1.1.2(Nov 26, 2015)

Owner
Christos Kasketis
Curious about how things work.
Christos Kasketis
Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened his eyes

GodEye Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened hi

陈奕龙(子循) 3.7k Dec 23, 2022
Remote network and data debugging for your native iOS app using Chrome Developer Tools

PonyDebugger PonyDebugger is a remote debugging toolset. It is a client library and gateway server combination that uses Chrome Developer Tools on you

Square 5.9k Dec 24, 2022
iOS network debugging, like a wizard 🧙‍♂️

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

Paolo Musolino 2.1k Jan 8, 2023
Profiling / Debugging assist tools for iOS. (Memory Leak, OOM, ANR, Hard Stalling, Network, OpenGL, Time Profile ...)

MTHawkeye Readme 中文版本 MTHawkeye is profiling, debugging tools for iOS used in Meitu. It's designed to help iOS developers improve development producti

meitu 1.4k Dec 29, 2022
Droar is a modular, single-line installation debugging window

Droar is a modular, single-line installation debugging window. Overview The idea behind Droar is simple: during app deployment stages, adding quick ap

Myriad Mobile 55 Sep 24, 2022
Set of easy to use debugging tools for iOS developers & QA engineers.

DBDebugToolkit DBDebugToolkit is a debugging library written in Objective-C. It is meant to provide as many easily accessible tools as possible while

Dariusz Bukowski 1.2k Dec 30, 2022
An in-app debugging and exploration tool for iOS

FLEX FLEX (Flipboard Explorer) is a set of in-app debugging and exploration tools for iOS development. When presented, FLEX shows a toolbar that lives

FLEXTool 13.3k Dec 31, 2022
Chisel is a collection of LLDB commands to assist debugging iOS apps.

Chisel Chisel is a collection of LLDB commands to assist in the debugging of iOS apps. [Installation • Commands • Custom Commands • Development Workfl

Facebook 8.9k Jan 6, 2023
Next generation debugging framework for iOS

Alpha is the idea of a next generation debugging framework for iOS applications. It combines multiple debugging tools built on top of a simple, unifie

Dal Rupnik 733 Oct 29, 2022
Dotzu In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.

Dotzu In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More. The debugger tool for iOS developer. Display logs, n

Remi ROBERT 1.8k Jan 3, 2023
Free macOS app for iOS view debugging.

Introduction You can inspect and modify views in iOS app via Lookin, just like UI Inspector in Xcode, or another app called Reveal. Official Website:h

Li Kai 575 Dec 28, 2022
A collection of tools for debugging, diffing, and testing your application's data structures.

Custom Dump A collection of tools for debugging, diffing, and testing your application's data structures. Motivation customDump diff XCTAssertNoDiffer

Point-Free 631 Jan 3, 2023
Convenient debugging button.

FunnyButton Example 在平时开发,运行期间有时候想中途看一下某个视图或变量的信息,虽说打断点是可以查看,但有时候断点调试有时候会卡住好一会才能看到(尤其是大项目经常卡很久),极度影响效率。 基于这种情况,FunnyButton就是为了能够便捷调试的全局按钮,添加好点击事件,就能随时

健了个平_(:з」∠)_ 2 Sep 20, 2022
a iOS network debug library, monitor HTTP requests

NetworkEye README 中文 NetworkEye,a iOS network debug library,monitor HTTP requests. It can be detected HTTP request include web pages, NSURLConnection,

coderyi 1.4k Dec 31, 2022
A swift network profiler built on top of URLSession.

By Xmartlabs SRL. Introduction Xniffer is a non-intrusive framework for intercepting outgoing requests and their responses between your app and any ex

xmartlabs 498 Dec 24, 2022
TouchInspector - a lightweight package that helps you visualize and debug touches on iOS and iPadOS

TouchInspector is a lightweight package that helps you visualize and debug touches on iOS and iPadOS.

Janum Trivedi 116 Jan 3, 2023
📘A library for isolated developing UI components and automatically taking snapshots of them.

A library for isolated developing UI components and automatically taking snapshots of them. Playbook Playbook is a library that provides a sandbox for

Playbook 970 Jan 3, 2023
In-app console and debug tools for iOS developers

LocalConsole Welcome to LocalConsole! This Swift Package makes on-device debugging easy with a convenient PiP-style console that can display items in

Duraid Abdul 650 Jan 1, 2023
Customizable Console UI overlay with debug log on top of your iOS App

AEConsole Customizable Console UI overlay with debug log on top of your iOS App AEConsole is built on top of AELog, so you should probably see that fi

Marko Tadić 142 Dec 21, 2022