iOS App SDK问题快速排查-离线日志和debug日志

App开发相关产品技术讨论,包括OEM App、App SDK等话题


Post Reply
Aaron
Posts: 1

iOS 接入App SDK会遇到问题,可以通过开发者平台的文档进行排查,也可以通过日志进行分析,日志分析分为debug日志和离线日志,可以按照需要进行配置,详细内容如下:

  • debug模式

AppSDK本地调试可以开启debug模式,帮助快速定位问题
注:App上架要关闭debug模式
代码配置如下:

Code: Select all

#ifdef DEBUG
    //Home SDK
    [[ThingSmartSDK sharedInstance] setDebugMode:YES];
    //IPC SDK
    [[ThingSmartCameraSDK sharedInstance] setDebugMode:YES];
#else
#endif
  • 离线日志

离线日志可以在本地调试时使用也可以线上App使用,日志通过加密写入沙盒路径,开发者可以获取沙盒路径获取日志,由于数据加密,开发者可以提交工单联系涂鸦定位问题,有助于复杂场景问题(如IPC拉流等)分析定位
代码配置如下:

Code: Select all

pod 'ThingSmartLogger'
#import <ThingSmartLogger/ThingLogSDK.h>

@interface AppDelegate ()
@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // your other code
    [ThingLogSDK startLog];
    // print log path
    NSLog(@"%@", [ThingLogSDK logPath]);
    return YES;
}

@end
Post Reply