How to collect log information on iOS?

Logging on iOS is configured using logLevel property of AbtoPhoneCfg class:
@property(class, nonatomic, assign) int logLevel;

  • – logLevel must be in range 0..5, 0 to disable logging and 1-5 to increase verbosity.

Recommended way to enable logs
in Swift:
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
   ...
   AbtoPhoneConfig.logLevel = 5
   ...
}

in Objective-C:
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   ...
   AbtoPhoneConfig.logLevel = 5;
   ...
}

Note that when logs are enabled, i.e. logLevel > 0 then SDK also will generate log files in application sandbox path, which are located in AppData/Library/Caches. Developer can collect log files from device using Xcode: select Window menu option => Devices and Simulators => select device => find and select your app => press gear icon located at the end of the app list, select Download container and choose folder to store container in. When container is saved you can inspect xcappdata using Finder, just select file, open context menu and choose “Show Package Contents” then navigate as usually to AppData/Library/Caches and locate files log_[data].txt

Posted in: FAQ