snapshot 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6af17a18ac0afbd425c435781e0b8ac827581d12
4
- data.tar.gz: 3755960f20b06fef9e168c11a85e69c65d460a73
3
+ metadata.gz: 8e9a3bdd92f26c6fb438e58ac38b9e3dacd4b55d
4
+ data.tar.gz: 0f72ce53c3c5fbe8634ff5fc9d61d88c0929e8f8
5
5
  SHA512:
6
- metadata.gz: 81bb99f82a005ff0ae676de149de5dc950824626dad4063203d1d2b775157b4bfaee9ce6190544c66dea95074b1999a987ac4dcdfe69e7e35d77e564805327ee
7
- data.tar.gz: a90c8d9ba57e8ffdeb1cd68aa599ca3ad52082fd8e1c51492361b0bbc1f777b4c874cbf78cd4a99b1fbe47c737119aac3804c3cf319749c79c9ff8341fc1bab4
6
+ metadata.gz: 9bf6c703c5d25c7cb403c1b644ecf1e94949fac393d62d29b6478bb77e5c2fd5fe596c321f84fe93535dc49bcd37adf27677fd479f6d83fcb5e6247441687886
7
+ data.tar.gz: c4d53cd5b1fe7ceb648f064a01e238866d38264bec7537a980cc00917cfaf7dadf4804c82cc5deaae8e98012756fc2caf5e0f0df58d2bac317a15a553db5e473
data/README.md CHANGED
@@ -10,7 +10,8 @@
10
10
  <b>snapshot</b> &bull;
11
11
  <a href="https://github.com/KrauseFx/frameit">frameit</a> &bull;
12
12
  <a href="https://github.com/KrauseFx/PEM">PEM</a> &bull;
13
- <a href="https://github.com/KrauseFx/sigh">sigh</a>
13
+ <a href="https://github.com/KrauseFx/sigh">sigh</a> &bull;
14
+ <a href="https://github.com/KrauseFx/produce">produce</a>
14
15
  </p>
15
16
  -------
16
17
 
@@ -151,6 +152,12 @@ To skip cleaning the project:
151
152
  snapshot --noclean
152
153
  ```
153
154
 
155
+ By default, `snapshot`, will re-install the app, to make sure it's in a clean state. In case you don't want this run
156
+
157
+ ```
158
+ SNAPSHOT_SKIP_UNINSTALL=1 snapshot
159
+ ```
160
+
154
161
  ## Snapfile
155
162
 
156
163
  #### Why should you have to remember complicated commands and parameters?
@@ -257,6 +264,13 @@ end
257
264
  ### Skip alpha removal from screenshots
258
265
  In case you want to skip this process, just add ```skip_alpha_removal``` to your ```Snapfile```.
259
266
 
267
+ ### Pass Bundle Identifier
268
+ This is only required in case there is a problem automatically detecting it.
269
+
270
+ ```
271
+ SNAPSHOT_APP_IDENTIFIER="com.krausefx.app" snapshot
272
+ ```
273
+
260
274
  # Tips
261
275
 
262
276
  ## [`fastlane`](http://fastlane.tools) Toolchain
@@ -266,6 +280,7 @@ In case you want to skip this process, just add ```skip_alpha_removal``` to your
266
280
  - [`frameit`](https://github.com/KrauseFx/frameit): Quickly put your screenshots into the right device frames
267
281
  - [`PEM`](https://github.com/KrauseFx/pem): Automatically generate and renew your push notification profiles
268
282
  - [`sigh`](https://github.com/KrauseFx/sigh): Because you would rather spend your time building stuff than fighting provisioning
283
+ - [`produce`](https://github.com/KrauseFx/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
269
284
 
270
285
  ## Run in Continuous Integration
271
286
  If you want to run `snapshot` on your `Jenkins` machine (or any other CI-system), you might run into an `authorization` popup coming up.
@@ -20,6 +20,7 @@ module Snapshot
20
20
  SnapshotConfig.shared_instance.languages.each do |language|
21
21
  SnapshotConfig.shared_instance.blocks[:setup_for_language_change].call(language, device) # Callback
22
22
 
23
+ reinstall_app(device, language) unless ENV["SNAPSHOT_SKIP_UNINSTALL"]
23
24
  begin
24
25
  errors.concat(run_tests(device, language))
25
26
  counter += copy_screenshots(language)
@@ -50,6 +51,33 @@ module Snapshot
50
51
  FileUtils.mkdir_p(TRACE_DIR)
51
52
  end
52
53
 
54
+ def reinstall_app(device, language)
55
+ def find_simulator(name) # fetches the UDID of the simulator type
56
+ all = `instruments -s`.split("\n")
57
+ all.each do |current|
58
+ return current.match(/\[(.*)\]/)[1] if current.include?name
59
+ end
60
+ raise "Could not find simulator '#{name}' to install the app on."
61
+ end
62
+
63
+ def app_identifier
64
+ @app_identifier ||= (ENV["SNAPSHOT_APP_IDENTIFIER"] || `/usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' /tmp/snapshot/build/*.app/*.plist`)
65
+ end
66
+
67
+ def com(cmd)
68
+ puts cmd.magenta
69
+ result = `#{cmd}`
70
+ puts result if result.to_s.length > 0
71
+ end
72
+
73
+ udid = find_simulator(device)
74
+ com("killall 'iOS Simulator'")
75
+ com("xcrun simctl boot '#{udid}'")
76
+ com("xcrun simctl uninstall '#{udid}' '#{app_identifier}'")
77
+ sleep 3
78
+ com("xcrun simctl install '#{udid}' '#{@app_path}'")
79
+ com("xcrun simctl shutdown '#{udid}'")
80
+ end
53
81
 
54
82
  def run_tests(device, language)
55
83
  Helper.log.info "Running tests on #{device} in language #{language}".green
@@ -1,3 +1,3 @@
1
1
  module Snapshot
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json