lib/simctl/device.rb in simctl-1.6.7 vs lib/simctl/device.rb in simctl-1.6.8
- old
+ new
@@ -2,10 +2,11 @@
require 'ostruct'
require 'simctl/device_launchctl'
require 'simctl/device_path'
require 'simctl/device_settings'
require 'simctl/object'
+require 'simctl/status_bar'
require 'timeout'
module SimCtl
class Device < Object
extend Gem::Deprecate
@@ -123,10 +124,22 @@
def path
@path ||= DevicePath.new(self)
end
+ # Change privacy settings
+ #
+ # @param action [String] grant, revoke, reset
+ # @param service [String] all, calendar, contacts-limited, contacts, location,
+ # location-always, photos-add, photos, media-library, microphone,
+ # motion, reminders, siri
+ # @param bundle [String] bundle identifier
+ # @return [void]
+ def privacy(action, service, bundle)
+ SimCtl.privacy(self, action, service, bundle)
+ end
+
# 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.
@@ -160,11 +173,11 @@
# @return [void]
def reset
SimCtl.reset_device name, devicetype, runtime
end
- # Resets the runtime
+ # Returns the runtime object
#
# @return [SimCtl::Runtime]
def runtime
@runtime ||= SimCtl.runtime(identifier: plist.runtime)
end
@@ -206,9 +219,16 @@
# Returns the state of the device
#
# @return [sym]
def state
@state.downcase.to_sym
+ end
+
+ # Returns the status bar object
+ #
+ # @return [SimCtl::StatusBar]
+ def status_bar
+ @status_bar ||= SimCtl::StatusBar.new(self)
end
# Reloads the device until the given block returns true
#
# @return [void]