Debugging Log File

Last Updated on : 2024-09-06 06:17:44

IPC SDK provides the TuyaSmartLogger component that implements the output of running logs to a local file. This helps you troubleshoot problems that arise during the integration with the IPC SDK. This topic describes how to integrate with this component.

  1. Add the following code block to the Podfile:

    pod 'TuyaSmartLogger'
    
  2. Add the following code block to the file AppDelegate.m:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    	// your other code
    	[TuyaSmartLogger startLog];
    	// print log path
    	NSLog(@"%@", [TuyaSmartLogger getDebugLogPath]);
    	return YES;
    }
    
  3. Run your app, go to the sandbox, and then find the log file in the path printed in Step 2.

    If you use a real device for debugging, export the sandbox file of your app in Xcode, as depicted in the following figure.

    Debugging Log File