项目主页    by: liman123     Star:    Fork:     

Travis CI CocoaPods Compatible Platform Language License MIT


Debugger tool for iOS, support both Swift and Objective-C language.


DebugMan has the following features:

  • Display all app network http requests details, including SDKs and image preview.
  • Display app device informations and app identity informations.
  • Preview and share sandbox files on device/simulator.
  • Display all app logs in different colors as you like.
  • App memory real-time monitoring.
  • Display app crash logs.

And More, DebugMan support shake device/simulator to hide/show the black bubble.


  • iOS 8.0+
  • Xcode 9.0+
  • Swift 3.0+


Use CocoaPods to install DebugMan by adding it to your Podfile:

platform :ios, '8.0'

target 'your_project' do
pod 'DebugMan', :configurations => ['Debug'] #Swift4
#pod 'DebugMan', '~> 3.x.x', :configurations => ['Debug'] #Swift3


Swift :

//  AppDelegate.swift
//  Swift Example

import UIKit

class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
        #if DEBUG
        return true

//MARK: - over write print()
public func print<T>(file: String = #file, function: String = #function, line: Int = #line, _ message: T, _ color: UIColor? = nil)
    #if DEBUG
        DebugManLog(file, function, line, message, color)

Objective-C :

//  AppDelegate.m
//  Objective-C Example

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    #ifdef DEBUG
        [[DebugMan shared] enableWithServerURL:nil ignoredURLs:nil onlyURLs:nil tabBarControllers:nil recordCrash:YES];
    return YES;


//  PrefixHeader.pch
//  Objective-C Example

#import "YourProject-Swift.h"

#pragma clang diagnostic ignored "-Wunused-value"

//default logs: white color
#ifdef DEBUG
#define NSLog(fmt, ...) [DebugMan NSLog:[[NSString stringWithUTF8String:__FILE__] lastPathComponent] :NSStringFromSelector(_cmd) :__LINE__ :(fmt, ##__VA_ARGS__) :[UIColor whiteColor]]
#define NSLog(fmt, ...) nil

//custom logs: red, yellow, blue, orange, gray colors...
#ifdef DEBUG
#define RedLog(fmt, ...) [DebugMan NSLog:[[NSString stringWithUTF8String:__FILE__] lastPathComponent] :NSStringFromSelector(_cmd) :__LINE__ :(fmt, ##__VA_ARGS__) :[UIColor redColor]]
#define RedLog(fmt, ...) nil

For More, See Swift and Objective-C demo Examples.



Matters Need Attention

Crash Reprting

If you are using crash reporting SDKs like Crashlytics or Bugly, I recommend to close DebugMan crash reporting (set recordCrash value to be false).

key window

  • When using DebugMan, app's key window is DebugMan's transparent window. You can check app's UI layout by Reveal.

  • If you want to get the root view controller for the app's key window, UIApplication.shared.keyWindow?.rootViewController may crash. You should use UIApplication.shared.delegate?.window??.rootViewController.

  • If you want to show a toast in app's key window, like MBProgressHUD SVProgressHUD, UIApplication.shared.keyWindow to get app's key window may cause toast invisible. You should use UIApplication.shared.delegate?.window.



DebugMan is available under the MIT license. See the LICENSE file for more info.