TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2016 |
Maintained by Scott Richards.
Tracks binary image loading. Creates a log of all the loaded dynamic libraries.
To run the example project, clone the repo, and run pod install
from the Example directory first. This example is written in Objective C. To save the log call writeLog() to access the log call lastLog(). Here is an example abbreviated log:
Library Loading Log Started: 2016-09-26 08:30:42 -0700
Loaded: 0x10e1f9000 /Users/scottrichards/Library/Developer/CoreSimulator/Devices/DC414095-3DDB-44F3-BC57-6FEA102C00C7/data/Containers/Bundle/Application/9C101138-F63F-4B29-9FCC-88AB4663F227/LibLoggerPod_Example.app/LibLoggerPod_Example
...
Library Loading Log Completed: 2016-09-26 08:30:52
This Cocoapod library is written in Objective C. It was built and tested with XCode 7.3. I tested it in a swift app as well as an ObjectiveC application.
LibLoggerPod is available as a CocoaPod. To install it, simply add the following line to your Podfile with the path to the cocoapod:
pod "LibLoggerPod", :path => '../'
Add following to include file:
import <LibLoggerPod>
To output the log call LibraryLogger.writeLog()
you will want to do this before your application exits it can be called multiple times it will just rewrite the log with previous log and any additional log info. You may want to add a call in your AppDelegate applicationWillResignActive or applicationDidEnterBackground methods.
Write out log in Swift:
func applicationWillResignActive(application: UIApplication) {
LibraryLogger.writeLog()
}
To get the last log call: LibraryLogger.lastLog()
for example in Swift:
logTextView.text = LibraryLogger.lastLog()
For Objective C add following to include file:
#import "LibraryLogger.h"
To get the last log call: [LibraryLogger lastLog]
for example in Swift: Objective C:
self.logTextView.text = [LibraryLogger lastLog];
To output the log call [LibraryLogger writeLog]
you will want to do this before your application exits it can be called multiple times it will just rewrite the log with previous log and any additional log info. You may want to add a call in your AppDelegate applicationWillResignActive or applicationDidEnterBackground methods.
- (void)applicationWillResignActive:(UIApplication *)application
{
[LibraryLogger writeLog];
}
Scott Richards, [email protected]
LibLoggerPod is available under the MIT license. See the LICENSE file for more info.