Skip to content

Commit 072cb68

Browse files
authored
Merge pull request #188 from mattrubin/screenshots
Update Screenshots
2 parents 51d3e46 + 3ef797c commit 072cb68

6 files changed

+64
-13
lines changed

fastlane/README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
fastlane documentation
22
================
33
# Installation
4+
5+
Make sure you have the latest version of the Xcode command line tools installed:
6+
47
```
5-
sudo gem install fastlane
8+
xcode-select --install
69
```
10+
11+
## Choose your installation method:
12+
13+
<table width="100%" >
14+
<tr>
15+
<th width="33%"><a href="http://brew.sh">Homebrew</a></td>
16+
<th width="33%">Installer Script</td>
17+
<th width="33%">Rubygems</td>
18+
</tr>
19+
<tr>
20+
<td width="33%" align="center">macOS</td>
21+
<td width="33%" align="center">macOS</td>
22+
<td width="33%" align="center">macOS or Linux with Ruby 2.0.0 or above</td>
23+
</tr>
24+
<tr>
25+
<td width="33%"><code>brew cask install fastlane</code></td>
26+
<td width="33%"><a href="https://download.fastlane.tools">Download the zip file</a>. Then double click on the <code>install</code> script (or run it in a terminal window).</td>
27+
<td width="33%"><code>sudo gem install fastlane -NV</code></td>
28+
</tr>
29+
</table>
730
# Available Actions
831
## iOS
932
### ios icons
@@ -35,5 +58,5 @@ Deploy a new version to the App Store
3558
----
3659

3760
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
38-
More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools).
39-
The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane/tree/master/fastlane).
61+
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
62+
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

fastlane/SnapshotHelper.swift

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ open class Snapshot: NSObject {
4242

4343
do {
4444
let trimCharacterSet = CharacterSet.whitespacesAndNewlines
45-
deviceLanguage = try NSString(contentsOfFile: path, encoding: String.Encoding.utf8.rawValue).trimmingCharacters(in: trimCharacterSet) as String
45+
deviceLanguage = try String(contentsOf: path, encoding: .utf8).trimmingCharacters(in: trimCharacterSet)
4646
app.launchArguments += ["-AppleLanguages", "(\(deviceLanguage))"]
4747
} catch {
4848
print("Couldn't detect/set language...")
@@ -58,7 +58,7 @@ open class Snapshot: NSObject {
5858

5959
do {
6060
let trimCharacterSet = CharacterSet.whitespacesAndNewlines
61-
locale = try NSString(contentsOfFile: path, encoding: String.Encoding.utf8.rawValue).trimmingCharacters(in: trimCharacterSet) as String
61+
locale = try String(contentsOf: path, encoding: .utf8).trimmingCharacters(in: trimCharacterSet)
6262
} catch {
6363
print("Couldn't detect/set locale...")
6464
}
@@ -77,7 +77,7 @@ open class Snapshot: NSObject {
7777
app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES", "-ui_testing"]
7878

7979
do {
80-
let launchArguments = try NSString(contentsOfFile: path, encoding: String.Encoding.utf8.rawValue) as String
80+
let launchArguments = try String(contentsOf: path, encoding: String.Encoding.utf8)
8181
let regex = try NSRegularExpression(pattern: "(\\\".+?\\\"|\\S+)", options: [])
8282
let matches = regex.matches(in: launchArguments, options: [], range: NSRange(location:0, length:launchArguments.characters.count))
8383
let results = matches.map { result -> String in
@@ -100,6 +100,8 @@ open class Snapshot: NSObject {
100100

101101
#if os(tvOS)
102102
XCUIApplication().childrenMatchingType(.Browser).count
103+
#elseif os(OSX)
104+
XCUIApplication().typeKey(XCUIKeyboardKeySecondaryFn, modifierFlags: [])
103105
#else
104106
XCUIDevice.shared().orientation = .unknown
105107
#endif
@@ -118,21 +120,47 @@ open class Snapshot: NSObject {
118120
}
119121
}
120122

121-
class func pathPrefix() -> NSString? {
122-
if let path = ProcessInfo().environment["SIMULATOR_HOST_HOME"] as NSString? {
123-
return path.appendingPathComponent("Library/Caches/tools.fastlane") as NSString?
124-
}
125-
print("Couldn't find Snapshot configuration files at ~/Library/Caches/tools.fastlane")
126-
return nil
123+
class func pathPrefix() -> URL? {
124+
let homeDir: URL
125+
//on OSX config is stored in /Users/<username>/Library
126+
//and on iOS/tvOS/WatchOS it's in simulator's home dir
127+
#if os(OSX)
128+
guard let user = ProcessInfo().environment["USER"] else {
129+
print("Couldn't find Snapshot configuration files - can't detect current user ")
130+
return nil
131+
}
132+
133+
guard let usersDir = FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
134+
print("Couldn't find Snapshot configuration files - can't detect `Users` dir")
135+
return nil
136+
}
137+
138+
homeDir = usersDir.appendingPathComponent(user)
139+
#else
140+
guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else {
141+
print("Couldn't find simulator home location. Please, check SIMULATOR_HOST_HOME env variable.")
142+
return nil
143+
}
144+
guard let homeDirUrl = URL(string: simulatorHostHome) else {
145+
print("Can't prepare environment. Simulator home location is inaccessible. Does \(simulatorHostHome) exist?")
146+
return nil
147+
}
148+
homeDir = homeDirUrl
149+
#endif
150+
return homeDir.appendingPathComponent("Library/Caches/tools.fastlane")
127151
}
128152
}
129153

130154
extension XCUIElement {
131155
var isLoadingIndicator: Bool {
156+
let whiteListedLoaders = ["GeofenceLocationTrackingOn", "StandardLocationTrackingOn"]
157+
if whiteListedLoaders.contains(self.identifier) {
158+
return false
159+
}
132160
return self.frame.size == CGSize(width: 10, height: 20)
133161
}
134162
}
135163

136164
// Please don't remove the lines below
137165
// They are used to detect outdated configuration files
138-
// SnapshotHelperVersion [1.2]
166+
// SnapshotHelperVersion [1.3]
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)