reset-sim 1.1 → 1.1.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/reset-sim +27 -32
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8df816b0b18a3704e6ead7fbcdc4340766b8023d
4
- data.tar.gz: 502d0ad32d86a08fd2ffc03788a3fdaa2a6eb4c3
3
+ metadata.gz: 27098c4ccbd598b01cffe8c3e215f17d62af8b7e
4
+ data.tar.gz: 2b9483db8a67d1eb2627fb540d478cad3dd5e9c9
5
5
  SHA512:
6
- metadata.gz: 8a73f5cd0899cdca0d0c583a8cece823c61f7e5241f75b676009a4ae5ea1580385301755d948fa91e74c3542d0a59cb76467c3e133b90e8eeadcc5acf074f50d
7
- data.tar.gz: f3b5522abf03f942a83ff654dc423cab627d5ebd01024b83150e21b5d773325776bd36349fe11333ebded10c6bb392133802f52ef86e51ef42b87ecb5e4bf8a2
6
+ metadata.gz: 073e05f09bf7547e2e3e968c6f89c38807f8afbb75eec856aef9424fc582e4303079a679033c464117ded000506d2a2ea8c0ff21047d5366b5800eed0b35fd2c
7
+ data.tar.gz: 0ca6b429904122e65703fe52195f294afc4aa6fc109cb5571967052b7d1c2153146957fdfee2f33fa1ec7e92e65a8f3fb64a48d1ba93cc6bb27ecd2207f2fdc2
@@ -5,43 +5,38 @@ def osascript(script)
5
5
  end
6
6
 
7
7
  osascript <<-END
8
- tell application "iOS Simulator"
9
- activate
10
- end tell
11
8
 
12
- tell application "System Events"
13
- tell process "iOS Simulator"
14
- tell menu bar 1
15
- tell menu bar item "iOS Simulator"
16
- tell menu "iOS Simulator"
17
- click menu item "Reset Content and Settings…"
18
- end tell
19
- end tell
20
- end tell
21
- tell window 1
22
- click button "Reset"
23
- end tell
24
- end tell
25
- end tell
26
- END
9
+ -- assume most people are on xcode7 or greater
10
+ -- so try that first
11
+ set simulator_app_name to missing value
12
+ try
13
+ tell application "Simulator" to activate
14
+ set simulator_app_name to "Simulator"
15
+ on error number -1728
16
+ log "Trying legacy iOS Simulator application..."
17
+ try
18
+ tell application "iOS Simulator" to activate
19
+ set simulator_app_name to "iOS Simulator"
20
+ on error number -1728
21
+ log "No Simulator application installed"
22
+ end try
23
+ end try
27
24
 
28
- osascript <<-END
29
- tell application "Simulator"
30
- activate
31
- end tell
32
25
 
33
- tell application "System Events"
34
- tell process "Simulator"
35
- tell menu bar 1
36
- tell menu bar item "Simulator"
37
- tell menu "Simulator"
38
- click menu item "Reset Content and Settings…"
26
+ if simulator_app_name is not equal to missing value
27
+ tell application "System Events"
28
+ tell process simulator_app_name
29
+ tell menu bar 1
30
+ tell menu bar item simulator_app_name
31
+ tell menu simulator_app_name
32
+ click menu item "Reset Content and Settings…"
33
+ end tell
39
34
  end tell
40
35
  end tell
41
- end tell
42
- tell window 1
43
- click button "Reset"
36
+ tell window 1
37
+ click button "Reset"
38
+ end tell
44
39
  end tell
45
40
  end tell
46
- end tell
41
+ end if
47
42
  END
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reset-sim
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rickert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake