fastlane 2.61.0.beta.20171006010004 → 2.61.0.beta.20171007010004
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -161
- data/cert/README.md +7 -166
- data/deliver/README.md +7 -287
- data/deliver/lib/deliver/runner.rb +1 -1
- data/fastlane/README.md +7 -209
- data/fastlane/lib/fastlane/actions/cocoapods.rb +27 -8
- data/fastlane/lib/fastlane/actions/docs/assets/FrameitGit.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/MacExample.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/PEMRecording.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/PilotTextTransparent.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/PilotTextTransparentSmall.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/PilotTextWhite.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/PilotTransparent.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/QuickLookScreenshot.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/ScreenshotsBig.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/ScreenshotsOverview.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/SignErrors.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/UDIDPrint.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/frameit.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/github_repo.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/htmlPage.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/htmlPagePreview.jpg +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/htmlPagePreviewFade.jpg +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/match.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/match_appstore_small.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/match_init.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/match_nuke.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/pem.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/pilot.ai +5377 -16
- data/fastlane/lib/fastlane/actions/docs/assets/precheck.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/precheck.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/produce.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/running-screengrab.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/scan.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/scanHTML.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/scanHTMLFailing.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/scanScreenshot.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/screengrab.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/sigh.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/sighRecording.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/slack.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/snapshot.gif +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/snapshot.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/supply.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/assets/testSummary.png +0 -0
- data/fastlane/lib/fastlane/actions/docs/cert.md +2 -4
- data/fastlane/lib/fastlane/actions/docs/deliver.md +1 -3
- data/fastlane/lib/fastlane/actions/docs/frameit.md +215 -0
- data/fastlane/lib/fastlane/actions/docs/gym.md +17 -17
- data/fastlane/lib/fastlane/actions/docs/match.md +352 -0
- data/fastlane/lib/fastlane/actions/docs/pem.md +120 -0
- data/fastlane/lib/fastlane/actions/docs/pilot.md +218 -0
- data/fastlane/lib/fastlane/actions/docs/precheck.md +97 -0
- data/fastlane/lib/fastlane/actions/docs/produce.md +227 -0
- data/fastlane/lib/fastlane/actions/docs/scan.md +145 -0
- data/fastlane/lib/fastlane/actions/docs/screengrab.md +145 -0
- data/fastlane/lib/fastlane/actions/docs/sigh.md +187 -0
- data/fastlane/lib/fastlane/actions/docs/snapshot.md +333 -0
- data/fastlane/lib/fastlane/actions/docs/supply.md +144 -0
- data/fastlane/lib/fastlane/plugins/plugin_manager.rb +5 -0
- data/fastlane/lib/fastlane/setup/setup_ios.rb +2 -0
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/frameit/README.md +7 -290
- data/gym/README.md +7 -300
- data/match/README.md +7 -420
- data/match/lib/match/generator.rb +1 -0
- data/match/lib/match/git_helper.rb +31 -12
- data/match/lib/match/runner.rb +11 -6
- data/pem/README.md +7 -188
- data/pilot/README.md +7 -285
- data/pilot/lib/pilot/build_manager.rb +13 -10
- data/precheck/README.md +7 -171
- data/produce/README.md +7 -294
- data/scan/README.md +7 -219
- data/screengrab/README.md +7 -192
- data/sigh/README.md +7 -262
- data/snapshot/README.md +7 -408
- data/snapshot/lib/snapshot/reset_simulators.rb +4 -2
- data/spaceship/lib/spaceship/test_flight/build.rb +1 -1
- data/supply/README.md +7 -219
- metadata +52 -2
data/snapshot/README.md
CHANGED
@@ -1,418 +1,17 @@
|
|
1
1
|
<h3 align="center">
|
2
|
-
<a href="https://
|
3
|
-
<img src="
|
2
|
+
<a href="https://docs.fastlane.tools/actions/snapshot">
|
3
|
+
<img src="https://raw.githubusercontent.com/fastlane/fastlane/master/fastlane/assets/fastlane.png" width="100" />
|
4
4
|
<br />
|
5
5
|
fastlane
|
6
6
|
</a>
|
7
7
|
</h3>
|
8
|
-
<p align="center">
|
9
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/deliver">deliver</a> •
|
10
|
-
<b>snapshot</b> •
|
11
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/frameit">frameit</a> •
|
12
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/pem">pem</a> •
|
13
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/sigh">sigh</a> •
|
14
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/produce">produce</a> •
|
15
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/cert">cert</a> •
|
16
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/spaceship">spaceship</a> •
|
17
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/pilot">pilot</a> •
|
18
|
-
<a href="https://github.com/fastlane/boarding">boarding</a> •
|
19
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/gym">gym</a> •
|
20
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/scan">scan</a> •
|
21
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/match">match</a> •
|
22
|
-
<a href="https://github.com/fastlane/fastlane/tree/master/precheck">precheck</a>
|
23
|
-
</p>
|
24
|
-
|
25
|
-
-------
|
26
|
-
|
27
|
-
<p align="center">
|
28
|
-
<img src="assets/snapshot.png" height="110">
|
29
|
-
</p>
|
30
|
-
|
31
|
-
snapshot
|
32
|
-
============
|
33
|
-
|
34
|
-
[![Twitter: @FastlaneTools](https://img.shields.io/badge/contact-@FastlaneTools-blue.svg?style=flat)](https://twitter.com/FastlaneTools)
|
35
|
-
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/fastlane/blob/master/snapshot/LICENSE)
|
36
|
-
|
37
|
-
###### Automate taking localized screenshots of your iOS and tvOS apps on every device
|
38
|
-
|
39
|
-
<hr />
|
40
|
-
<h4 align="center">
|
41
|
-
Check out the new <a href="https://docs.fastlane.tools/getting-started/ios/screenshots">fastlane documentation</a> on how to generate screenshots
|
42
|
-
</h4>
|
43
|
-
<hr />
|
44
|
-
|
45
|
-
_snapshot_ generates localized iOS and tvOS screenshots for different device types and languages for the App Store and can be uploaded using ([`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver)).
|
46
|
-
|
47
|
-
You have to manually create 20 (languages) x 6 (devices) x 5 (screenshots) = **600 screenshots**.
|
48
|
-
|
49
|
-
It's hard to get everything right!
|
50
|
-
|
51
|
-
- New screenshots with every (design) update
|
52
|
-
- No loading indicators
|
53
|
-
- Same content / screens
|
54
|
-
- [Clean Status Bar](#use-a-clean-status-bar)
|
55
|
-
- Uploading screenshots ([`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver) is your friend)
|
56
|
-
|
57
|
-
More information about [creating perfect screenshots](https://krausefx.com/blog/creating-perfect-app-store-screenshots-of-your-ios-app).
|
58
|
-
|
59
|
-
_snapshot_ runs completely in the background - you can do something else, while your computer takes the screenshots for you.
|
60
|
-
|
61
|
-
Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
|
62
8
|
|
63
|
-
|
9
|
+
------
|
64
10
|
|
65
11
|
<p align="center">
|
66
|
-
|
67
|
-
<
|
68
|
-
|
69
|
-
<a href="#quick-start">Quick Start</a> •
|
70
|
-
<a href="#usage">Usage</a> •
|
71
|
-
<a href="#tips">Tips</a> •
|
72
|
-
<a href="#how-does-it-work">How?</a> •
|
73
|
-
<a href="#need-help">Need help?</a>
|
12
|
+
<a href="https://docs.fastlane.tools/actions/snapshot">
|
13
|
+
<img src="https://raw.githubusercontent.com/fastlane/fastlane/master/snapshot/assets/snapshot.png" height="110">
|
14
|
+
</a>
|
74
15
|
</p>
|
75
16
|
|
76
|
-
|
77
|
-
|
78
|
-
<h5 align="center"><code>snapshot</code> is part of <a href="https://fastlane.tools">fastlane</a>: The easiest way to automate beta deployments and releases for your iOS and Android apps.</h5>
|
79
|
-
|
80
|
-
# Features
|
81
|
-
- Create hundreds of screenshots in multiple languages on all simulators
|
82
|
-
- Take screenshots in multiple device simulators concurrently to cut down execution time (Xcode 9 only)
|
83
|
-
- Configure it once, store the configuration in git
|
84
|
-
- Do something else, while the computer takes the screenshots for you
|
85
|
-
- Integrates with [`fastlane`](https://fastlane.tools) and [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver)
|
86
|
-
- Generates a beautiful web page, which shows all screenshots on all devices. This is perfect to send to QA or the marketing team
|
87
|
-
- _snapshot_ automatically waits for network requests to be finished before taking a screenshot (we don't want loading images in the App Store screenshots)
|
88
|
-
|
89
|
-
##### [Do you like fastlane? Be the first to know about updates and new fastlane tools](https://tinyletter.com/fastlane-tools)
|
90
|
-
|
91
|
-
After _snapshot_ successfully created new screenshots, it will generate a beautiful HTML file to get a quick overview of all screens:
|
92
|
-
|
93
|
-
![assets/htmlPagePreviewFade.jpg](assets/htmlPagePreviewFade.jpg)
|
94
|
-
|
95
|
-
## Why?
|
96
|
-
|
97
|
-
This tool automatically switches the language and device type and runs UI Tests for every combination.
|
98
|
-
|
99
|
-
### Why should I automate this process?
|
100
|
-
|
101
|
-
- It takes **hours** to take screenshots
|
102
|
-
- You get a great overview of all your screens, running on all available simulators without the need to manually start it hundreds of times
|
103
|
-
- Easy verification for translators (without an iDevice) that translations do make sense in real App context
|
104
|
-
- Easy verification that localizations fit into labels on all screen dimensions
|
105
|
-
- It is an integration test: You can test for UI elements and other things inside your scripts
|
106
|
-
- Be so nice, and provide new screenshots with every App Store update. Your customers deserve it
|
107
|
-
- You realise, there is a spelling mistake in one of the screens? Well, just correct it and re-run the script
|
108
|
-
|
109
|
-
# Installation
|
110
|
-
|
111
|
-
Install the gem
|
112
|
-
|
113
|
-
sudo gem install fastlane
|
114
|
-
|
115
|
-
Make sure, you have the latest version of the Xcode command line tools installed:
|
116
|
-
|
117
|
-
xcode-select --install
|
118
|
-
|
119
|
-
# UI Tests
|
120
|
-
|
121
|
-
## Getting started
|
122
|
-
This project uses Apple's newly announced UI Tests. We will not go into detail on how to write scripts.
|
123
|
-
|
124
|
-
Here a few links to get started:
|
125
|
-
|
126
|
-
- [WWDC 2015 Introduction to UI Tests](https://developer.apple.com/videos/play/wwdc2015-406/)
|
127
|
-
- [A first look into UI Tests](http://www.mokacoding.com/blog/xcode-7-ui-testing/)
|
128
|
-
- [UI Testing in Xcode 7](http://masilotti.com/ui-testing-xcode-7/)
|
129
|
-
- [HSTestingBackchannel : ‘Cheat’ by communicating directly with your app](https://github.com/ConfusedVorlon/HSTestingBackchannel)
|
130
|
-
- [Automating App Store screenshots using fastlane snapshot and frameit](https://tisunov.github.io/2015/11/06/automating-app-store-screenshots-generation-with-fastlane-snapshot-and-sketch.html)
|
131
|
-
|
132
|
-
# Quick Start
|
133
|
-
|
134
|
-
- Create a new UI Test target in your Xcode project ([top part of this article](https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line))
|
135
|
-
- Run `fastlane snapshot init` in your project folder
|
136
|
-
- Add the ./SnapshotHelper.swift to your UI Test target (You can move the file anywhere you want)
|
137
|
-
- **Note:** if you're using Xcode 8, add the ./SnapshotHelperXcode8.swift to your UI Test target
|
138
|
-
- (Objective C only) add the bridging header to your test class.
|
139
|
-
- `#import "MYUITests-Swift.h"`
|
140
|
-
- The bridging header is named after your test target with -Swift.h appended.
|
141
|
-
- In your UI Test class, click the `Record` button on the bottom left and record your interaction
|
142
|
-
- To take a snapshot, call the following between interactions
|
143
|
-
- Swift: `snapshot("01LoginScreen")`
|
144
|
-
- Objective C: `[Snapshot snapshot:@"01LoginScreen" waitForLoadingIndicator:YES];`
|
145
|
-
- Add the following code to your `setUp()` method
|
146
|
-
|
147
|
-
**Swift**
|
148
|
-
```swift
|
149
|
-
let app = XCUIApplication()
|
150
|
-
setupSnapshot(app)
|
151
|
-
app.launch()
|
152
|
-
```
|
153
|
-
|
154
|
-
**Objective C**
|
155
|
-
```objective-c
|
156
|
-
XCUIApplication *app = [[XCUIApplication alloc] init];
|
157
|
-
[Snapshot setupSnapshot:app];
|
158
|
-
[app launch];
|
159
|
-
```
|
160
|
-
|
161
|
-
_Make sure you only have one `launch` call in your test class, as Xcode adds one automatically on new test files._
|
162
|
-
|
163
|
-
![assets/snapshot.gif](assets/snapshot.gif)
|
164
|
-
|
165
|
-
You can try the _snapshot_ [example project](https://github.com/fastlane/fastlane/tree/master/snapshot/example) by cloning this repo.
|
166
|
-
|
167
|
-
To quick start your UI tests, you can use the UI Test recorder. You only have to interact with the simulator, and Xcode will generate the UI Test code for you. You can find the red record button on the bottom of the screen (more information in [this blog post](https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line))
|
168
|
-
|
169
|
-
# Usage
|
170
|
-
|
171
|
-
```sh
|
172
|
-
fastlane snapshot
|
173
|
-
```
|
174
|
-
|
175
|
-
Your screenshots will be stored in the `./screenshots/` folder by default (or `./fastlane/screenshots` if you're using [fastlane](https://fastlane.tools))
|
176
|
-
|
177
|
-
New with Xcode 9, *snapshot* can run multiple simulators concurrently. This is the default behavior in order to take your screenshots as quickly as possible. This can be disabled to run each device, one at a time, by setting the `:concurrent_simulators` option to `false`.
|
178
|
-
|
179
|
-
**Note:** While running *snapshot* with Xcode 9, the simulators will not be visibly spawned. So, while you wont see the simulators running your tests, they will, in fact, be taking your screenshots.
|
180
|
-
|
181
|
-
If any error occurs while running the snapshot script on a device, that device will not have any screenshots, and _snapshot_ will continue with the next device or language. To stop the flow after the first error, run
|
182
|
-
|
183
|
-
```sh
|
184
|
-
fastlane snapshot --stop_after_first_error
|
185
|
-
```
|
186
|
-
|
187
|
-
Also by default, _snapshot_ will open the HTML after all is done. This can be skipped with the following command
|
188
|
-
|
189
|
-
|
190
|
-
```sh
|
191
|
-
fastlane snapshot --stop_after_first_error --skip_open_summary
|
192
|
-
```
|
193
|
-
|
194
|
-
There are a lot of options available that define how to build your app, for example
|
195
|
-
|
196
|
-
```sh
|
197
|
-
fastlane snapshot --scheme "UITests" --configuration "Release" --sdk "iphonesimulator"
|
198
|
-
```
|
199
|
-
|
200
|
-
Reinstall the app before running _snapshot_
|
201
|
-
|
202
|
-
```sh
|
203
|
-
fastlane snapshot --reinstall_app --app_identifier "tools.fastlane.app"
|
204
|
-
```
|
205
|
-
|
206
|
-
By default _snapshot_ automatically retries running UI Tests if they fail. This is due to randomly failing UI Tests (e.g. [#372](https://github.com/fastlane/snapshot/issues/372)). You can adapt this number using
|
207
|
-
|
208
|
-
```sh
|
209
|
-
fastlane snapshot --number_of_retries 3
|
210
|
-
```
|
211
|
-
|
212
|
-
Add photos and/or videos to the simulator before running _snapshot_
|
213
|
-
|
214
|
-
```sh
|
215
|
-
fastlane snapshot --add_photos MyTestApp/Assets/demo.jpg --add_videos MyTestApp/Assets/demo.mp4
|
216
|
-
```
|
217
|
-
|
218
|
-
For a list for all available options run
|
219
|
-
|
220
|
-
```sh
|
221
|
-
fastlane snapshot --help
|
222
|
-
```
|
223
|
-
|
224
|
-
After running _snapshot_ you will get a nice summary:
|
225
|
-
|
226
|
-
<img src="assets/testSummary.png" width="500">
|
227
|
-
|
228
|
-
## Snapfile
|
229
|
-
|
230
|
-
All of the available options can also be stored in a configuration file called the `Snapfile`. Since most values will not change often for your project, it is recommended to store them there:
|
231
|
-
|
232
|
-
First make sure to have a `Snapfile` (you get it for free when running `fastlane snapshot init`)
|
233
|
-
|
234
|
-
The `Snapfile` can contain all the options that are also available on `fastlane snapshot --help`
|
235
|
-
|
236
|
-
|
237
|
-
```ruby
|
238
|
-
scheme "UITests"
|
239
|
-
|
240
|
-
devices([
|
241
|
-
"iPhone 6",
|
242
|
-
"iPhone 6 Plus",
|
243
|
-
"iPhone 5",
|
244
|
-
"iPhone 4s"
|
245
|
-
])
|
246
|
-
|
247
|
-
languages([
|
248
|
-
"en-US",
|
249
|
-
"de-DE",
|
250
|
-
"es-ES",
|
251
|
-
["pt", "pt_BR"] # Portuguese with Brazilian locale
|
252
|
-
])
|
253
|
-
|
254
|
-
launch_arguments(["-username Felix"])
|
255
|
-
|
256
|
-
# The directory in which the screenshots should be stored
|
257
|
-
output_directory './screenshots'
|
258
|
-
|
259
|
-
clear_previous_screenshots true
|
260
|
-
|
261
|
-
add_photos ["MyTestApp/Assets/demo.jpg"]
|
262
|
-
|
263
|
-
```
|
264
|
-
|
265
|
-
### Completely reset all simulators
|
266
|
-
|
267
|
-
You can run this command in the terminal to delete and re-create all iOS and tvOS simulators:
|
268
|
-
|
269
|
-
```
|
270
|
-
fastlane snapshot reset_simulators
|
271
|
-
```
|
272
|
-
|
273
|
-
**Warning**: This will delete **all** your simulators and replace by new ones! This is useful, if you run into weird problems when running _snapshot_.
|
274
|
-
|
275
|
-
You can use the environment variable `SNAPSHOT_FORCE_DELETE` to stop asking for confirmation before deleting.
|
276
|
-
|
277
|
-
## Update snapshot helpers
|
278
|
-
|
279
|
-
Some updates require the helper files to be updated. _snapshot_ will automatically warn you and tell you how to update.
|
280
|
-
|
281
|
-
Basically you can run
|
282
|
-
|
283
|
-
```
|
284
|
-
fastlane snapshot update
|
285
|
-
```
|
286
|
-
|
287
|
-
to update your `SnapshotHelper.swift` files. In case you modified your `SnapshotHelper.swift` and want to manually update the file, check out [SnapshotHelper.swift](https://github.com/fastlane/fastlane/blob/master/snapshot/lib/assets/SnapshotHelper.swift).
|
288
|
-
|
289
|
-
## Launch Arguments
|
290
|
-
|
291
|
-
You can provide additional arguments to your app on launch. These strings will be available in your app (eg. not in the testing target) through `ProcessInfo.processInfo.arguments`. Alternatively, use user-default syntax (`-key value`) and they will be available as key-value pairs in `UserDefaults.standard`.
|
292
|
-
|
293
|
-
```ruby
|
294
|
-
launch_arguments([
|
295
|
-
"-firstName Felix -lastName Krause"
|
296
|
-
])
|
297
|
-
```
|
298
|
-
|
299
|
-
```swift
|
300
|
-
name.text = UserDefaults.standard.string(forKey: "firstName")
|
301
|
-
// name.text = "Felix"
|
302
|
-
```
|
303
|
-
|
304
|
-
_snapshot_ includes `-FASTLANE_SNAPSHOT YES`, which will set a temporary user default for the key `FASTLANE_SNAPSHOT`, you may use this to detect when the app is run by _snapshot_.
|
305
|
-
|
306
|
-
```swift
|
307
|
-
if UserDefaults.standard.bool(forKey: "FASTLANE_SNAPSHOT") {
|
308
|
-
// runtime check that we are in snapshot mode
|
309
|
-
}
|
310
|
-
```
|
311
|
-
|
312
|
-
Specify multiple argument strings and _snapshot_ will generate screenshots for each combination of arguments, devices, and languages. This is useful for comparing the same screenshots with different feature flags, dynamic text sizes, and different data sets.
|
313
|
-
|
314
|
-
```ruby
|
315
|
-
# Snapfile for A/B Test Comparison
|
316
|
-
launch_arguments([
|
317
|
-
"-secretFeatureEnabled YES",
|
318
|
-
"-secretFeatureEnabled NO"
|
319
|
-
])
|
320
|
-
```
|
321
|
-
|
322
|
-
# How does it work?
|
323
|
-
|
324
|
-
The easiest solution would be to just render the UIWindow into a file. That's not possible because UI Tests don't run on a main thread. So _snapshot_ uses a different approach:
|
325
|
-
|
326
|
-
When you run unit tests in Xcode, the reporter generates a plist file, documenting all events that occurred during the tests ([More Information](http://michele.io/test-logs-in-xcode)). Additionally, Xcode generates screenshots before, during and after each of these events. There is no way to manually trigger a screenshot event. The screenshots and the plist files are stored in the DerivedData directory, which _snapshot_ stores in a temporary folder.
|
327
|
-
|
328
|
-
When the user calls `snapshot(...)` in the UI Tests (Swift or Objective C) the script actually does a rotation to `.Unknown` which doesn't have any effect on the actual app, but is enough to trigger a screenshot. It has no effect to the application and is not something you would do in your tests. The goal was to find *some* event that a user would never trigger, so that we know it's from _snapshot_. On tvOS, there is no orientation so we ask for a count of app views with type "Browser" (which should never exist on tvOS).
|
329
|
-
|
330
|
-
_snapshot_ then iterates through all test events and check where we either did this weird rotation (on iOS) or searched for browsers (on tvOS). Once _snapshot_ has all events triggered by _snapshot_ it collects a ordered list of all the file names of the actual screenshots of the application.
|
331
|
-
|
332
|
-
In the test output, the Swift _snapshot_ function will print out something like this
|
333
|
-
|
334
|
-
> snapshot: [some random text here]
|
335
|
-
|
336
|
-
_snapshot_ finds all these entries using a regex. The number of _snapshot_ outputs in the terminal and the number of _snapshot_ events in the plist file should be the same. Knowing that, _snapshot_ automatically matches these 2 lists to identify the name of each of these screenshots. They are then copied over to the output directory and separated by language and device.
|
337
|
-
|
338
|
-
2 thing have to be passed on from _snapshot_ to the `xcodebuild` command line tool:
|
339
|
-
|
340
|
-
- The device type is passed via the `destination` parameter of the `xcodebuild` parameter
|
341
|
-
- The language is passed via a temporary file which is written by _snapshot_ before running the tests and read by the UI Tests when launching the application
|
342
|
-
|
343
|
-
If you find a better way to do any of this, please submit an issue on GitHub or even a pull request :+1:
|
344
|
-
|
345
|
-
Radar [23062925](https://openradar.appspot.com/radar?id=5056366381105152) has been resolved with Xcode 8.3, so it's now possible to actually take screenshots from the simulator. We'll keep using the old approach for now, since many of you still want to use older versions of Xcode.
|
346
|
-
|
347
|
-
# Tips
|
348
|
-
|
349
|
-
<hr />
|
350
|
-
<h4 align="center">
|
351
|
-
Check out the new <a href="https://docs.fastlane.tools/getting-started/ios/screenshots">fastlane documentation</a> on how to generate screenshots
|
352
|
-
</h4>
|
353
|
-
<hr />
|
354
|
-
|
355
|
-
## [`fastlane`](https://fastlane.tools) Toolchain
|
356
|
-
|
357
|
-
- [`fastlane`](https://fastlane.tools): The easiest way to automate beta deployments and releases for your iOS and Android apps
|
358
|
-
- [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver): Upload screenshots, metadata and your app to the App Store
|
359
|
-
- [`frameit`](https://github.com/fastlane/fastlane/tree/master/frameit): Quickly put your screenshots into the right device frames
|
360
|
-
- [`PEM`](https://github.com/fastlane/fastlane/tree/master/pem): Automatically generate and renew your push notification profiles
|
361
|
-
- [`sigh`](https://github.com/fastlane/fastlane/tree/master/sigh): Because you would rather spend your time building stuff than fighting provisioning
|
362
|
-
- [`produce`](https://github.com/fastlane/fastlane/tree/master/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
|
363
|
-
- [`cert`](https://github.com/fastlane/fastlane/tree/master/cert): Automatically create and maintain iOS code signing certificates
|
364
|
-
- [`spaceship`](https://github.com/fastlane/fastlane/tree/master/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
|
365
|
-
- [`pilot`](https://github.com/fastlane/fastlane/tree/master/pilot): The best way to manage your TestFlight testers and builds from your terminal
|
366
|
-
- [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
|
367
|
-
- [`gym`](https://github.com/fastlane/fastlane/tree/master/gym): Building your iOS apps has never been easier
|
368
|
-
- [`scan`](https://github.com/fastlane/fastlane/tree/master/scan): The easiest way to run tests of your iOS and Mac app
|
369
|
-
- [`match`](https://github.com/fastlane/fastlane/tree/master/match): Easily sync your certificates and profiles across your team using git
|
370
|
-
- [`precheck`](https://github.com/fastlane/fastlane/tree/master/precheck): Check your app using a community driven set of App Store review rules to avoid being rejected
|
371
|
-
|
372
|
-
##### [Do you like fastlane? Be the first to know about updates and new fastlane tools](https://tinyletter.com/fastlane-tools)
|
373
|
-
|
374
|
-
## Frame the screenshots
|
375
|
-
|
376
|
-
If you want to add frames around the screenshots and even put a title on top, check out [frameit](https://github.com/fastlane/fastlane/tree/master/frameit).
|
377
|
-
|
378
|
-
## Available language codes
|
379
|
-
```ruby
|
380
|
-
ALL_LANGUAGES = ["da", "de-DE", "el", "en-AU", "en-CA", "en-GB", "en-US", "es-ES", "es-MX", "fi", "fr-CA", "fr-FR", "id", "it", "ja", "ko", "ms", "nl-NL", "no", "pt-BR", "pt-PT", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"]
|
381
|
-
```
|
382
|
-
|
383
|
-
To get more information about language and locale codes please read [Internationalization and Localization Guide](https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html).
|
384
|
-
|
385
|
-
## Use a clean status bar
|
386
|
-
You can use [SimulatorStatusMagic](https://github.com/shinydevelopment/SimulatorStatusMagic) to clean up the status bar.
|
387
|
-
|
388
|
-
## Editing the `Snapfile`
|
389
|
-
Change syntax highlighting to *Ruby*.
|
390
|
-
|
391
|
-
### Simulator doesn't launch the application
|
392
|
-
|
393
|
-
When the app dies directly after the application is launched there might be 2 problems
|
394
|
-
|
395
|
-
- The simulator is somehow in a broken state and you need to re-create it. You can use `snapshot reset_simulators` to reset all simulators (this will remove all installed apps)
|
396
|
-
- A restart helps very often
|
397
|
-
|
398
|
-
## Determine language
|
399
|
-
|
400
|
-
To detect the currently used localization in your tests, access the `deviceLanguage` variable from `SnapshotHelper.swift`.
|
401
|
-
|
402
|
-
# Need help?
|
403
|
-
|
404
|
-
Before submitting a new GitHub issue, please make sure to
|
405
|
-
|
406
|
-
- Check out [docs.fastlane.tools](https://docs.fastlane.tools)
|
407
|
-
- Check out the README pages on [this repo](https://github.com/fastlane/fastlane)
|
408
|
-
- Search for [existing GitHub issues](https://github.com/fastlane/fastlane/issues)
|
409
|
-
|
410
|
-
If the above doesn't help, please [submit an issue](https://github.com/fastlane/fastlane/issues) on GitHub and provide information about your setup, in particular the output of the `fastlane env` command.
|
411
|
-
|
412
|
-
# Code of Conduct
|
413
|
-
Help us keep _snapshot_ open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/fastlane/blob/master/CODE_OF_CONDUCT.md).
|
414
|
-
|
415
|
-
# License
|
416
|
-
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
417
|
-
|
418
|
-
> This project and all fastlane tools are in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.
|
17
|
+
<h3 align="center">The <i>snapshot</i> docs were moved to <a href='https://docs.fastlane.tools/actions/snapshot'>docs.fastlane.tools</a></h3>
|
@@ -7,7 +7,7 @@ module Snapshot
|
|
7
7
|
|
8
8
|
sure = true if FastlaneCore::Env.truthy?("SNAPSHOT_FORCE_DELETE") || force
|
9
9
|
begin
|
10
|
-
sure = UI.confirm("Are you sure? All your simulators will be DELETED and new ones will be created!") unless sure
|
10
|
+
sure = UI.confirm("Are you sure? All your simulators will be DELETED and new ones will be created! (You can use `SNAPSHOT_FORCE_DELETE` to skip this confirmation)") unless sure
|
11
11
|
rescue => e
|
12
12
|
UI.user_error!("Please make sure to pass the `--force` option to reset simulators when running in non-interactive mode") unless UI.interactive?
|
13
13
|
raise e
|
@@ -66,7 +66,9 @@ module Snapshot
|
|
66
66
|
def self.create(device_type, os_versions, os_name = 'iOS')
|
67
67
|
os_versions.each do |os_version|
|
68
68
|
puts "Creating #{device_type[0]} for #{os_name} version #{os_version[0]}"
|
69
|
-
|
69
|
+
command = "xcrun simctl create '#{device_type[0]}' #{device_type[1]} #{os_version[1]}"
|
70
|
+
UI.command(command) if FastlaneCore::Globals.verbose?
|
71
|
+
`#{command}`
|
70
72
|
end
|
71
73
|
end
|
72
74
|
|
@@ -136,7 +136,7 @@ module Spaceship::TestFlight
|
|
136
136
|
|
137
137
|
# Getting builds from BuildTrains only gets a partial Build object
|
138
138
|
# We are then requesting the full build from iTC when we need to access
|
139
|
-
# any of the variables below, because they are not
|
139
|
+
# any of the variables below, because they are not included in the partial Build objects
|
140
140
|
#
|
141
141
|
# `super` here calls `beta_review_info` as defined by the `attr_mapping` above.
|
142
142
|
# @return (Spaceship::TestFlight::BetaReviewInfo)
|