Class: DeviceAPI::IOS::IDeviceDebug
- Inherits:
-
Execution
- Object
- Execution
- DeviceAPI::IOS::IDeviceDebug
- Defined in:
- lib/device_api/ios/idevicedebug.rb
Overview
Namespace for all methods encapsulating idevice calls
Class Method Summary collapse
-
.run(options = {}) ⇒ Hash
idevicedebug doesn’t return until the app you are attempting to run exits.
Class Method Details
.run(options = {}) ⇒ Hash
idevicedebug doesn’t return until the app you are attempting to run exits. By passing in a timeout value we can limit how long we wait before terminating the debug session
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/device_api/ios/idevicedebug.rb', line 16 def self.run( = {}) serial = [:serial] bundle_id = [:bundle_id] timeout = [:timeout] || 10 result = execute("doalarm () { perl -e 'alarm shift; exec @ARGV' \"$@\"; }; doalarm #{timeout} idevicedebug -u #{serial} -d run #{bundle_id}") raise IDeviceDebugError.new(result.stderr) unless [0, 255, 142].include?(result.exit) result.stdout.split("\r\n") end |