simctl 1.0.0 → 1.0.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/simctl/command.rb +4 -0
- data/lib/simctl/command/create.rb +1 -1
- data/lib/simctl/command/kill.rb +18 -0
- data/lib/simctl/command/launch.rb +19 -0
- data/lib/simctl/device.rb +8 -0
- data/lib/simctl/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe7b798df933dcbdfdd2846945ca54fcadc5464
|
4
|
+
data.tar.gz: 6f37177c83e58a6b2ee88761645a324a15a0aab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6988d3709f1ceeb1012862d812e86cb4003d280193eba5e2a635d797220c6a7385112adb30c3d9a5c8a27a1629d8239632f12023d6ffbf5c2555c2e40edffdfb
|
7
|
+
data.tar.gz: 0cb73e083361d8a5aad520a36a931ce489f08178900716926f5f6348a57c900c5a8d49d6ffa69db70a6b047f7c458c2ed7c366c49cec35f0b6c1cb840abde35f
|
data/Gemfile.lock
CHANGED
data/lib/simctl/command.rb
CHANGED
@@ -2,6 +2,8 @@ require 'simctl/command/boot'
|
|
2
2
|
require 'simctl/command/create'
|
3
3
|
require 'simctl/command/delete'
|
4
4
|
require 'simctl/command/erase'
|
5
|
+
require 'simctl/command/kill'
|
6
|
+
require 'simctl/command/launch'
|
5
7
|
require 'simctl/command/list'
|
6
8
|
require 'simctl/command/shutdown'
|
7
9
|
require 'simctl/executor'
|
@@ -12,6 +14,8 @@ module SimCtl
|
|
12
14
|
include SimCtl::Command::Create
|
13
15
|
include SimCtl::Command::Delete
|
14
16
|
include SimCtl::Command::Erase
|
17
|
+
include SimCtl::Command::Kill
|
18
|
+
include SimCtl::Command::Launch
|
15
19
|
include SimCtl::Command::List
|
16
20
|
include SimCtl::Command::Shutdown
|
17
21
|
end
|
@@ -24,7 +24,7 @@ module SimCtl
|
|
24
24
|
# @yield [exception] an exception that might happen during shutdown/delete of the old device
|
25
25
|
def reset_device(name, device_type, runtime)
|
26
26
|
begin
|
27
|
-
|
27
|
+
list_devices.where(name: name, os: runtime.name).each do |device|
|
28
28
|
device.shutdown! if device.state != 'Shutdown'
|
29
29
|
device.delete!
|
30
30
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module SimCtl
|
2
|
+
class Command
|
3
|
+
module Kill
|
4
|
+
# Kills a Simulator instance with the given device
|
5
|
+
#
|
6
|
+
# @param device [SimCtl::Device] the device to kill
|
7
|
+
# @return [void]
|
8
|
+
def kill_device(device)
|
9
|
+
pid = `ps xww | grep Simulator.app | grep -s #{device.udid} | grep -v grep | awk '{print $1}'`.chomp
|
10
|
+
if pid.to_i > 0
|
11
|
+
system 'kill', pid
|
12
|
+
else
|
13
|
+
false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module SimCtl
|
2
|
+
class Command
|
3
|
+
module Launch
|
4
|
+
XCODE_HOME = `xcode-select -p`.chomp
|
5
|
+
|
6
|
+
# Launches a Simulator instance with the given device
|
7
|
+
#
|
8
|
+
# @param device [SimCtl::Device] the device to launch
|
9
|
+
# @return [void]
|
10
|
+
def launch_device(device)
|
11
|
+
# Launching the same device twice does not work.
|
12
|
+
# Simulator.app would just hang. Solution: Kill first.
|
13
|
+
kill_device(device)
|
14
|
+
command = "open -n #{XCODE_HOME}/Applications/Simulator.app --args -ConnectHardwareKeyboard 0 -CurrentDeviceUDID #{device.udid}"
|
15
|
+
system command
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/simctl/device.rb
CHANGED
data/lib/simctl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simctl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Plunien
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -87,6 +87,8 @@ files:
|
|
87
87
|
- lib/simctl/command/create.rb
|
88
88
|
- lib/simctl/command/delete.rb
|
89
89
|
- lib/simctl/command/erase.rb
|
90
|
+
- lib/simctl/command/kill.rb
|
91
|
+
- lib/simctl/command/launch.rb
|
90
92
|
- lib/simctl/command/list.rb
|
91
93
|
- lib/simctl/command/shutdown.rb
|
92
94
|
- lib/simctl/device.rb
|
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
122
|
version: '0'
|
121
123
|
requirements: []
|
122
124
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.5.2
|
124
126
|
signing_key:
|
125
127
|
specification_version: 4
|
126
128
|
summary: Ruby interface to xcrun simctl
|