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

Related tags

Debugging GodEye
Overview

GodEye

Version License Platform Carthage compatible

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.

中文文档

It's so huge that I split it into several independent components:

  • Log4G — Simple, lightweight logging framework written in Swift.
  • AssistiveButton — Simple Assistive Button.
  • AppBaseKit — A handy kit of Swift extensions and wrapped class to boost your productivity.
  • AppSwizzle — lightweight and flexible method swizzling wrapped by swift.
  • LeakEye — LeakEye is a memory leak monitor.
  • NetworkEye — NetworkEye is a network monitor,automatic catch the request and response infomation of all kinds of request send.
  • ANREye — ANREye is an ANR (Application Not Responding) monitor,automatic catch the ANR and return stacktrace of all threads.
  • ASLEye — ASLEye is an ASL(Apple System Log) monitor, automatic catch the log from NSLog by asl module.
  • CrashEye — CrashEye is an ios crash monitor,automatic catch exception crash & signal crash and return the stacktrace.
  • SystemEye — SystemEye is a system monitor,automatic catch the infomation of cpu,memory....etc.

Features

  • monitor for the log and point out log type.
  • monitor for the crash, include Uncatched Exception and Signal.
  • monitor for the network, all information of request and response.
  • monitor for the ANR, tell you the stacktrace of all threads.
  • monitor for the memory leak, tell you the leak object's class name.
  • a terminal for you to customized your commands and things what to do.
  • monitor for the cpu usage of system and application.
  • monitor for the ram usage of system and application.
  • monitor for the FPS.
  • monitor for the netflow of system and application.
  • a file browser for look through the sandbox, .app and root directory.
  • custom and runtime setting

Characteristics

  • richly: comprehensive feature
  • conveniently: one line code access
  • automaticly: no code intrusion
  • safety: no compile code in release

Preview

Book and Principle

I has wrote a book named 《iOS监控编程》,each chapter records the course function of the implementation details and the way to explore.sorry for english friends,this book wrote by chineses.

Installation

CocoaPods

GodEye is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GodEye"

Not build in Release

First, add configurations in Podfile.

pod 'GodEye', '~> 1.0.0', :configurations => ['Debug']

Then, find Other Swift Flags in your target's Build Settings,add DEBUG in Debug scheme.

Finally, add DEBUG macro in makeEye:

#if DEBUG 
    GodEye.makeEye(with: self.window!)
#endif

Carthage

Or, if you’re using Carthage, add GodEye to your Cartfile:

github "zixun/GodEye"

Add GodEye to Embed Frameworks

On your application targets’ “General” settings tab, in the “Embed Frameworks” section, drag and drop GodEye.framework from the Carthage/Build folder on disk.

Add Dependency to Linked Frameworks and Libraries

On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop the dependency framework used in GodEye from the Carthage/Build folder on disk.

Add Run Script

On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”:

OpenSource Application Use GodEye

CocoaChinaPlus is an open source application wrote by swift, now the GodEye is work well in it!

Usage

import at AppDelegate:

import GodEye

making GodEye at application:didFinishLaunchingWithOptions:

GodEye.makeEye(with:self.window!)

well, make GodEye with one line code as above will use default configuration.We also can custom our configuration:

let configuration = Configuration()
configuration.command.add(command: "test", description: "test command") { () -> (String) in
    return "this is test command result"
}
configuration.command.add(command: "info", description: "print test info") { () -> (String) in
    return "info"
}
    
GodEye.makeEye(with: self.window!, configuration: configuration)

the example above is custom command configuration, we also can custom control and switch configuration.see detail at ControlConfiguration and SwitchConfiguration

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

twitter: @zixun_

email: [email protected]

github: zixun

blog: 子循(SubCycle)

Thanks

First is Github, it gives me a lot of ideas and inspiration, and even ready-made code:

  • Log monitor inspired by AELog
  • Crash monitor inspired by GT
  • ANR monitor inspired by Watchdog
  • Network monitor inspired by NetworkEye

Secondly is StackOverFlow, it answers a lot of problems encountered in the author's writing and development,here are a few images of deep:

Finally, thanks to several great blog:

License

GodEye is available under the MIT license. See the LICENSE file for more info.

Comments
  • carthage error

    carthage error

    Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -workspace /Users/shenfangwei/Desktop/Demo/10_19_Carthage/Carthage/Checkouts/GodEye/Example/GodEye.xcworkspace -scheme GodEye -configuration Release -derivedDataPath /Users/shenfangwei/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/GodEye/1.1.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/shenfangwei/Desktop/Demo/10_19_Carthage/Carthage/Checkouts/GodEye)

    This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/x2/rpvy5yc175qdr8l91r674ddh0000gn/T/carthage-xcodebuild.KUbTyX.log

    opened by FrankSwift 6
  • enhancement - provide slim version for cocopods

    enhancement - provide slim version for cocopods

    I want to use this in project - but there's too many sub pod dependencies. eg. I just want logging. It would be great to not have to include everything / just to use the in app logging. (eg. sqlite logging stuff)

    opened by wwe-johndpope 5
  • Use sqlite3.0 replace dependency of SQLite.swift

    Use sqlite3.0 replace dependency of SQLite.swift

    I found SQLite.swift is so huge and it‘s unsuited for GodEye. such as https://github.com/zixun/GodEye/issues/22.

    so, in the next version of GodEye, I will Use sqlite3.0 without any dependency to replace the dependency of SQLite.swift

    enhancement 
    opened by zixun 4
  • 启动时崩溃

    启动时崩溃

    发生崩溃的类:NetworkRecordModel.swift

    发生崩溃的方法:fileprivate func initialize(response: HTTPURLResponse?, data:Data?)

    具体位置:

    do {
                let returnValue = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
                let data = try JSONSerialization.data(withJSONObject: returnValue)
                return String(data: data, encoding: .utf8)
            } catch  {
                return nil
            }
    

    异常详情:

     *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSJSONSerialization dataWithJSONObject:options:error:]: Invalid top-level type in JSON write'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x000000010bb8fd4b __exceptionPreprocess + 171
    	1   libobjc.A.dylib                     0x000000010b5f121e objc_exception_throw + 48
    	2   CoreFoundation                      0x000000010bbf92b5 +[NSException raise:format:] + 197
    	3   Foundation                          0x000000010b0e3500 +[NSJSONSerialization dataWithJSONObject:options:error:] + 249
    	4   GodEye                              0x00000001072fc03e _TFC6GodEye18NetworkRecordModelP33_CF214E9D732CCEC1FB66110322E8598F4jsonfT4fromGSqV10Foundation4Data__GSqSS_ + 750
    	5   GodEye                              0x00000001072f73a8 _TFC6GodEye18NetworkRecordModelP33_CF214E9D732CCEC1FB66110322E8598F10initializefT8responseGSqCSo15HTTPURLResponse_4dataGSqV10Foundation4Data__T_ + 2536
    	6   GodEye                              0x00000001072f5f48 _TFC6GodEye18NetworkRecordModelcfT7requestGSqV10Foundation10URLRequest_8responseGSqCSo15HTTPURLResponse_4dataGSqVS1_4Data__S0_ + 1288
    	7   GodEye                              0x00000001072f6076 _TFC6GodEye18NetworkRecordModelCfT7requestGSqV10Foundation10URLRequest_8responseGSqCSo15HTTPURLResponse_4dataGSqVS1_4Data__S0_ + 70
    	8   GodEye                              0x00000001072b23f1 _TFC6GodEye17ConsoleController18networkEyeDidCatchfT4withGSqV10Foundation10URLRequest_8responseGSqCSo11URLResponse_4dataGSqVS1_4Data__T_ + 497
    	9   GodEye                              0x00000001072b277e _TToFC6GodEye17ConsoleController18networkEyeDidCatchfT4withGSqV10Foundation10URLRequest_8responseGSqCSo11URLResponse_4dataGSqVS1_4Data__T_ + 206
    	10  GodEye                              0x00000001072b28a9 _TTDFC6GodEye17ConsoleController18networkEyeDidCatchfT4withGSqV10Foundation10URLRequest_8responseGSqCSo11URLResponse_4dataGSqVS1_4Data__T_ + 201
    	11  GodEye                              0x00000001072b27d1 _TTWC6GodEye17ConsoleController16NetworkEye_swift18NetworkEyeDelegateS_FS2_18networkEyeDidCatchfT4withGSqV10Foundation10URLRequest_8responseGSqCSo11URLResponse_4dataGSqVS3_4Data__T_ + 65
    	12  NetworkEye_swift                    0x00000001083b8b03 _TFC16NetworkEye_swift11EyeProtocol11stopLoadingfT_T_ + 627
    	13  NetworkEye_swift                    0x00000001083b8c52 _TToFC16NetworkEye_swift11EyeProtocol11stopLoadingfT_T_ + 34
    	14  CFNetwork                           0x0000000105fc95ca _ZN16CFURLProtocol_NS21forgetProtocolClient0Ev + 100
    	15  CFNetwork                           0x0000000105fc9553 ___ZN16CFURLProtocol_NS20forgetProtocolClientEv_block_invoke + 18
    	16  libdispatch.dylib                   0x000000010d5050cd _dispatch_client_callout + 8
    	17  libdispatch.dylib                   0x000000010d4df9a0 _dispatch_block_invoke_direct + 567
    	18  CFNetwork                           0x0000000105fc74c4 _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 24
    	19  CoreFoundation                      0x000000010bae03f4 CFArrayApplyFunction + 68
    	20  CFNetwork                           0x0000000105fc73bd _ZN19RunloopBlockContext7performEv + 137
    	21  CFNetwork                           0x0000000105fc7256 _ZN17MultiplexerSource7performEv + 282
    	22  CFNetwork                           0x0000000105fc7078 _ZN17MultiplexerSource8_performEPv + 72
    	23  CoreFoundation                      0x000000010bb34761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    	24  CoreFoundation                      0x000000010bb1998c __CFRunLoopDoSources0 + 556
    	25  CoreFoundation                      0x000000010bb18e76 __CFRunLoopRun + 918
    	26  CoreFoundation                      0x000000010bb18884 CFRunLoopRunSpecific + 420
    	27  CFNetwork                           0x00000001061e03d6 _ZL27_privateRunloopEmulationSetPv + 258
    	28  libsystem_pthread.dylib             0x000000010d8acaab _pthread_body + 180
    	29  libsystem_pthread.dylib             0x000000010d8ac9f7 _pthread_body + 0
    	30  libsystem_pthread.dylib             0x000000010d8ac1fd thread_start + 13
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    
    opened by gyzerocc 4
  • dyld: Library not loaded

    dyld: Library not loaded

    dyld: Library not loaded: @rpath/GodEye.framework/GodEye Referenced from: /var/containers/Bundle/Application/0BE59DC4-710C-4D79-ACC9-3B449ACE1E3A/GodEye_Example.app/GodEye_Example Reason: image not found

    运行后,崩溃啊

    opened by JunyiXie 3
  • Log4G 中 WeakLog4GDelegate 的必要性

    Log4G 中 WeakLog4GDelegate 的必要性

    作者,你好 如书中所说,WeakLog4GDelgate 的目的是防止 delegate 数组对元素进行强引用,未解决,所以用 WeakLog4GDelegate 包装一遍,用 weak 修饰以后,再放入数组。

    对此,NSPointArray 完全能解决这个问题:

    var a: NSPointerArray = NSPointerArray(options: [.weakMemory])

    类似容器类型还有:NSHashMapNSHashTable 等。

    不知在此使用这些容器类进行解决,是否与原意冲突。

    enhancement 
    opened by saitjr 2
Releases(1.1.2)
Owner
陈奕龙(子循)
陈奕龙(子循)
Demonstrates a memory leak bug SwiftUI's toolbar APIs exhibit on macOS

Mac SwiftUI Toolbar Memory Leak Demo On Big Sur (macOS 11), SwiftUI's APIs for adding toolbar items to a window have (at least) two bugs around view r

Matt Curtis 6 Aug 6, 2022
A lightweight, one line setup, iOS / OSX network debugging library! 🦊

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

Christos Kasketis 3.4k Dec 28, 2022
Network debugging made easy,This network debugging tool is developed based on the swift version of Wormholy.

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

null 21 Dec 14, 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
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
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
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
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
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
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
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
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
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
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
In-app design review tool to inspect measurements, attributes, and animations.

Hyperion Hyperion - In App Design Review Tool What is it? Hyperion is a hidden plugin drawer that can easily be integrated into any app. The drawer si

WillowTree, LLC 2k Dec 27, 2022
Tool to debug layouts directly on iOS devices: inspect layers in 3D and debug each visible view attributes

Introduction Features Inspect layouts directly on iOS devices Inspection could be triggered only if app is running under DEBUG build configuration, so

Ihor Savynskyi 510 Dec 24, 2022
📘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
A little and powerful iOS framework for intercepting HTTP/HTTPS Traffic.

A little and powerful iOS framework for intercepting HTTP/HTTPS Traffic from your app. No more messing around with proxy, certificate config. Features

Proxyman 874 Jan 6, 2023
Xray is viewDebugging tool for iOS, tvOS, watchOS and macOS

XRay XRay is view debugging tool for iOS. Currently, XRay can show all of the view hierarchies in UIKit. For SwiftUI, I'm working on it. XRay helps yo

Shawn Baek 10 Jun 10, 2022