I would like my app to run special code (e.g. resetting its state) when running in UI Testing mode. I looked at environment variables that are set when the app is running fr
In Swift 3 you can check for the XCInjectBundleInto key, or something that starts with XC.
XCInjectBundleInto
XC
let isInTestMode = ProcessInfo.processInfo.environment["XCInjectBundleInto"] != nil
This works in OS X as well.