Latest 0.5.0
License BSD 3-Clause
Platforms ios 5.0, requires ARC

MCDebuggingTools – Extermination helper

Badge w/ Version
Badge w/ Platform

Collection of debuging tools that can be added to your project


#import "AppDelegate.h"
#import "MCMemoryWarningGenerators.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
#ifdef DEBUG
  // Force memory warnings to occur every 60 seconds. Helps you ensure you're
  // handling them properly.

#ifdef DEBUG
  // Allocate a block of memory every 30 seconds. Helps ensure your application
  // can survive low memory conditions.

  return YES;


Extremely simple to use tool to simulate low memory conditions in your
application so you can ensure that it behaves correctly when receiving memory

// generates a simulated memory warning continuously at the specified interval
// in seconds.
// Allocates blocks of 5MB of memory continuously at the specified interval
// in seconds.


MCServerEnvironment helps to switch client base URL easily.

// Before initializing your MCServerEnvironment and client objects,
// create every URLs needed for your environment switcher
NSURL *devURL = [NSURL URLWithString:@"http://localhost"];
NSURL *ciURL = [NSURL URLWithString:@""];
NSURL *qaURL = [NSURL URLWithString:@""];
NSURL *stagingURL = [NSURL URLWithString:@""];
NSURL *productionURL = [NSURL URLWithString:@""];

// A default URL is required at MCServerEnvironment initialization
NSURL *defaultURL = nil;

#ifdef PROD_API
    defaultURL = stagingURL;
    defaultURL = stagingURL;
#elif QA_API
    defaultURL = qaURL;
#elif DEBUG
    defaultURL = ciURL;

// Create MCServerEnvironment object with needed URLs
_serverEnvironment = [[MCServerEnvironment alloc] initWithDefaultURL:defaultURL developmentURL:nil ciURL:ciURL qaURL:qaURL stagingURL:stagingURL productionURL:productionURL otherURLs:nil];

// Create your client object with MCServerEnvironment URL method
AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:[_serverEnvironment URL]];
// Required
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    // Tell MCServerEnvironment an URL Scheme has been called and give it a presenter view controller
    // If the URL host is equals to "env", a view controller will be presented
    [_serverEnvironment openURL:url presenterViewController:self.window.rootViewController completionBlock:nil];
    return YES;

// Optional
- (void)applicationDidBecomeActive:(UIApplication *)application
    // This will show an alert for 3 seconds with the setted base URL if it's not the default
    [_serverEnvironment showDebugAlert];

Adding to your project

If you’re using CocoaPods, there’s nothing simpler.
Add the following to your Podfile
and run pod install.

pod 'MCDebuggingTools', :git => ''

Don’t forget to #import "MCMemoryWarningGenerators.h" where it’s needed.


MCDebuggingTools is © 2013-2015 Mirego and may be freely
distributed under the New BSD license.
See the LICENSE file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.

Latest podspec

    "name": "MCDebuggingTools",
    "version": "0.5.0",
    "license": "BSD 3-Clause",
    "summary": "Various debugging tools to make your life easier.",
    "homepage": "",
    "authors": {
        "Mirego": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.5.0"
    "source_files": "MCDebuggingTools/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "5.0"

Pin It on Pinterest

Share This