lib/simctl/device.rb in simctl-1.6.1 vs lib/simctl/device.rb in simctl-1.6.2
- old
+ new
@@ -90,10 +90,19 @@
# @return [void]
def launch_app(identifier, args=[], opts={})
SimCtl.launch_app(self, identifier, args, opts)
end
+ # Terminates an app on the given device
+ #
+ # @param identifier [String] the app identifier
+ # @param args [Array] optional terminate arguments
+ # @return [void]
+ def terminate_app(identifier, args=[])
+ SimCtl.terminate_app(self, identifier, args)
+ end
+
# Opens the url on the device
#
# @param url [String] The url to be opened on the device
# @return [void]
def open_url(url)
@@ -102,19 +111,18 @@
def path
@path ||= DevicePath.new(self)
end
- # Returns true/false if the device is ready
+ # Returns true/false if the device is ready
# Uses [SimCtl::DeviceLaunchctl] to look for certain services being running.
#
# Unfortunately the 'booted' state does not mean the Simulator is ready for
# installing or launching applications.
- #
+ #
# @return [Bool]
def ready?
- # TODO: Should look for different services depending on device type (iphone/ipad, tv, watch)
running_services = launchctl.list.reject {|service| service.pid.to_i == 0 }.map {|service| service.name}
(required_services_for_ready - running_services).empty?
end
# Reloads the device information
@@ -238,15 +246,21 @@
'com.apple.mobileassetd',
'com.apple.networkd',
]
end
when :ios
- if Xcode::Version.gte? '8.0'
+ if Xcode::Version.gte? '9.0'
[
+ 'com.apple.backboardd',
+ 'com.apple.mobile.installd',
+ 'com.apple.CoreSimulator.bridge',
+ 'com.apple.SpringBoard',
+ ]
+ elsif Xcode::Version.gte? '8.0'
+ [
'com.apple.SimulatorBridge',
'com.apple.SpringBoard',
'com.apple.backboardd',
- 'com.apple.medialibraryd',
'com.apple.mobile.installd',
]
else
[
'com.apple.SimulatorBridge',