Skip to content

Latest commit

 

History

History
101 lines (76 loc) · 3.73 KB

README_EN.md

File metadata and controls

101 lines (76 loc) · 3.73 KB

logo

Pod Version Pod Platform Pod License GitHub release GitHub release Website

iOSLogBrowserSDK

A real-time iOS log tracing tool that enables viewing iOS logs on a PC web browser within a local area network. The log display automatically scrolls similar to Xcode console.

Features

  1. View output logs while operating, real-time log tracking without manual refresh.
  2. Compatible with all browsers, no Mac computer required.
  3. No need for USB cable connection to computer.
  4. Supports multiple computers monitoring logs simultaneously.

Demo

Installation

Method 1: iOSLogBrowserSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'iOSLogBrowserSDK'
pod 'Reachability'

Usage

#import <XLFacility/XLFacilityMacros.h>
#import <iOSLogBrowserSDK/iOSLogBrowserSDK.h>
#import <Reachability/Reachability.h>
@interface AppDelegate ()

@property(nonatomic, assign) BOOL started;

@end
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      // Override point for customization after application launch.
      self.started = NO;
      Reachability* reachability = [Reachability reachabilityForLocalWiFi];
      if([reachability isReachable])
      {
          [self start];
      }
      __weak typeof(self) weakSelf = self;
      reachability.reachableBlock = ^(Reachability *reachability) {
          NSLog(@"%@", @"Network Available");
          __strong typeof(self) strongSelf = weakSelf;
          if(!strongSelf) return;
          if(strongSelf.started)
          {
              return;
          }
          [strongSelf start];
      };
      reachability.unreachableBlock = ^(Reachability *reachability) {
          NSLog(@"%@", @"Network Unavailable");
      };
      [reachability startNotifier];
      return YES;
}

-(void) start
{
    iOSLogBrowserOption* option = [iOSLogBrowserOption defaultOption];
    option.suspendInBackground = YES;
    [iOSLogBrowserSDK startWithOption:option];

    XLOG_INFO(@"%@", @"You are using iOS LAN Log Viewing Service!");
    self.started = YES;
}

@end

⚠️ Important Note:

  1. When using on iOS physical devices, please ensure your App has permission to access local WiFi.

Follow us

Twitter URL Twitter Follow