import UIKit

func isRunningTests() -> Bool {

    return NSProcessInfo.processInfo().environment["XCInjectBundle"] != nil
}

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {

        println("is running tests? \(isRunningTests())")
        return true
    }
}
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
}
--- 
+++ 
@@ -1,7 +1,18 @@
 import UIKit
+
+func isRunningTests() -> Bool {
+
+    return NSProcessInfo.processInfo().environment["XCInjectBundle"] != nil
+}
 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
 
     var window: UIWindow?
+
+    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
+
+        println("is running tests? \(isRunningTests())")
+        return true
+    }
 }
Add function to differentiate between test run and normal run of the app
