zixun / godeye Goto Github PK
View Code? Open in Web Editor NEWAutomaticly 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
License: MIT License
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
License: MIT License
🌝节省编译时间, 你懂的...
@zixun 您好请教一下~~
不知道是否我执行方式有问题,尝试了各种方式还是没有成功跑起来demo
1,我clone项目GodEye后没有看到readme文件提到的Example文件夹,而是一个GodEye_Example
文件夹。是在这里运行Pod instal?应该不是吧,里边本身没带podfile。所以默认应该不是readme中说的。
2,看GodEye项目中有carthage文件,里边配置了要下载的包,所以猜测应该默认是carthage方式运行?
所以carthage update了一下GodEye
然后build就报了两个错,如下图:
如果加上carthage加上 github "zixun/GodEye"
carthage update就会报错
如果不加这个那么,在Carthage/Build中就不会有GodEye.framework
不知道是我哪处理的有问题么?
望回复
多谢了~
你好 计算APP占用率:
/// Get CPU usage of application,get from all thread
open class func applicationUsage() -> Double {
let threads = self.threadBasicInfos()
var result : Double = 0.0
threads.forEach { (thread:thread_basic_info) in
if self.flag(thread) {
result += Double.init(thread.cpu_usage) / Double.init(TH_USAGE_SCALE);
}
}
return result * 100
}
这个方法计算出来CPU占用率有超过100% 这是正确情况吗
。。。
Overriding default location of GodEye button
issue: #17
status: DOWN!
Adjusted the project code,be more friendly between Carthage and Cocoapods
issue: #24
status: DOWN!
Monitor the screenshot to be editable and shareable for user
status: DOING
Adjusted ODUIThreadGuard code with the author and add it to GodEye to do UI draw thread guard
issue: olddonkey/ODUIThreadGuard#12
status: DOING
Change WeakLog4GDelegate to NSHashTable
issue:#19
status: DOING
bugfix~
My code:
`
UIViewController.swizzleInstanceMethod(origSelector: Selector.dealloc, toAlterSelector: Selector.swizzle_dealloc)
@objc
func swizzle_dealloc() {
#if DEBUG
print("dealloc:------ \(self))")
#endif
}
`
Crash in
NSObject+Alive.swift
view.agent?.responder = r
不太爱cocoapods, 尝试手动添加,貌似有点问题,不知道有尝试过么
Unable to find a specification for "GodEye"
网络使用gzip, network模块中没有相应请求响应数据数据
example 跑出来有错,修改后切换tab也会crash
直接点击Signal Crash
重新打开app没有发现crash日志,然后进入app再重新点击Exception Crash
才会把前面那个Signle
的日志打印出来
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)
作者,你好
如书中所说,WeakLog4GDelgate 的目的是防止 delegate 数组对元素进行强引用,未解决,所以用 WeakLog4GDelegate 包装一遍,用 weak 修饰以后,再放入数组。
对此,NSPointArray 完全能解决这个问题:
var a: NSPointerArray = NSPointerArray(options: [.weakMemory])
类似容器类型还有:NSHashMap
,NSHashTable
等。
不知在此使用这些容器类进行解决,是否与原意冲突。
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
运行后,崩溃啊
我发现不知道是不是问题:
1、GodEye_Example目录下没有Podfile, pod install无法执行
2、自己添加podfile之后,xcode编译不过,提示 No such module 'SQLite'
牛逼啊
I found SQLite.swift
is so huge and it‘s unsuited for GodEye. such as #22.
so, in the next version of GodEye, I will Use sqlite3.0 without any dependency to replace the dependency of SQLite.swift
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
氢弹这里尝试购买,但是支付失败!
这块需要自己设置什么才能生效吗。只是简单的做了个测试,push了个带有循环引用的控制器,然后pop
发生崩溃的类: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
I've got a quick patch to be able to specify (override) the default location of the GodEye button:
GodEye/Classes/Configuration/Configuration.swift
Add:
open class Configuration: NSObject {
open private(set) var command = CommandConfiguration()
/// default switch configuration
open private(set) var defaultSwitch = SwitchConfiguration()
open var location:CGPoint? // Override default location of the GodEye button
}
GodEye/Classes/UIWindow+GodEye.swift
extension UIWindow {
func makeEye(with configuration:Configuration) {
GodEyeController.shared.configuration = configuration
.
.
.
Replace:
let rect = CGRect(x: self.frame.size.width - 48, y: self.frame.size.height - 160, width: 48, height: 48)
With:
var rect = CGRect(x: self.frame.size.width - 48, y: self.frame.size.height - 160, width: 48, height: 48)
if let location = configuration.location {
rect.origin = location
}
Usage:
let configuration = Configuration()
configuration.location = CGPoint(x: 40.0, y: 40.0)
GodEye.makeEye(with: self.window!, configuration: configuration)
There are cleaner ways of doing this, of course (e.g. put defaults in header, then just overwrite the x: and y: values), but I wanted to be the least intrusive as possible. :)
从2018年就说适配swift4。
Unable to find a specification for AppBaseKit
depended upon by GodEye
首先感谢大神提供这个功能~
想问下打包或者测release的情况下是不是要把import和makeEye方法注释了呀?我现在会报错呢……
As described in the title.
I find this issue when I try to drag the GodEye source code to build it in my project.
thanks for your reply :)
能不能支持下Swift Package
你好 大牛,里面监控卡顿类ANREye,不是很稳定,就是每次都能监控的到 ,好几次都监控不到卡顿,跟bugly对不上,这是什么原因呢? 用监控RunLoop是每一次都可以监控的到 ,哪个更好呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.