Class for monitor excessive blocking on the main thread
This library is derived from the GodEye project which can automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code. Just like god opened his eyes
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.
ANREye is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "ANREye"
Or, if you’re using Carthage, add SwViewCapture to your Cartfile:
github "zixun/ANREye"
self.anrEye = ANREye()
self.anrEye.delegate = self
self.anrEye.start(with: 1)
extension ViewController: ANREyeDelegate {
func anrEye(anrEye:ANREye,
catchWithThreshold threshold:Double,
mainThreadBacktrace:String?,
allThreadBacktrace:String?) {
print("------------------")
print(mainThreadBacktrace!)
print("------------------")
print(allThreadBacktrace!)
}
}
var s = ""
for _ in 0..<9999 {
for _ in 0..<9999 {
s.append("1")
}
}
print("invoke")
name: 陈奕龙
twitter: @zixun_
email: chenyl.exe@gmail.com
github: zixun
blog: 子循(SubCycle)
ANREye is available under the MIT license. See the LICENSE file for more info.