         }
     }
 
-    class func pathPrefix() -> NSString? {
-        if let path = ProcessInfo().environment["SIMULATOR_HOST_HOME"] as NSString? {
-            return path.appendingPathComponent("Library/Caches/tools.fastlane") as NSString?
-        }
-        print("Couldn't find Snapshot configuration files at ~/Library/Caches/tools.fastlane")
-        return nil
+    class func pathPrefix() -> URL? {
+        let homeDir: URL
+        //on OSX config is stored in /Users/<username>/Library
+        //and on iOS/tvOS/WatchOS it's in simulator's home dir
+        #if os(OSX)
+            guard let user = ProcessInfo().environment["USER"] else {
+                print("Couldn't find Snapshot configuration files - can't detect current user ")
+                return nil
+            }
+
+            guard let usersDir =  FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
+                print("Couldn't find Snapshot configuration files - can't detect `Users` dir")
+                return nil
+            }
+
+            homeDir = usersDir.appendingPathComponent(user)
+        #else
+            guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else {
+                print("Couldn't find simulator home location. Please, check SIMULATOR_HOST_HOME env variable.")
+                return nil
+            }
+            guard let homeDirUrl = URL(string: simulatorHostHome) else {
+                print("Can't prepare environment. Simulator home location is inaccessible. Does \(simulatorHostHome) exist?")
+                return nil
+            }
+            homeDir = URL(fileURLWithPath: homeDirUrl.path)
+        #endif
+        return homeDir.appendingPathComponent("Library/Caches/tools.fastlane")
     }
 }
 
 extension XCUIElement {
     var isLoadingIndicator: Bool {
+        let whiteListedLoaders = ["GeofenceLocationTrackingOn", "StandardLocationTrackingOn"]
+        if whiteListedLoaders.contains(self.identifier) {
+            return false
+        }
         return self.frame.size == CGSize(width: 10, height: 20)
     }
 }
 
 // Please don't remove the lines below
 // They are used to detect outdated configuration files
-// SnapshotHelperVersion [1.2]
+// SnapshotHelperVersion [1.4]


        do {
            let trimCharacterSet = CharacterSet.whitespacesAndNewlines
            locale = try NSString(contentsOfFile: path, encoding: String.Encoding.utf8.rawValue).trimmingCharacters(in: trimCharacterSet) as String
        } catch {
            print("Couldn't detect/set locale...")
        }

        app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES", "-ui_testing"]

        do {
            let launchArguments = try String(contentsOf: path, encoding: String.Encoding.utf8)
            let regex = try NSRegularExpression(pattern: "(\\\".+?\\\"|\\S+)", options: [])
            let matches = regex.matches(in: launchArguments, options: [], range: NSRange(location:0, length:launchArguments.characters.count))
            let results = matches.map { result -> String in
