Class: IOSDeploy
- Inherits:
-
Object
- Object
- IOSDeploy
- Defined in:
- lib/IOSDeploy.rb
Instance Method Summary collapse
- #connected_devices ⇒ Object
-
#initialize ⇒ IOSDeploy
constructor
A new instance of IOSDeploy.
- #install_apk(device, filename) ⇒ Object
- #install_to_all_devices(filename) ⇒ Object
Constructor Details
#initialize ⇒ IOSDeploy
Returns a new instance of IOSDeploy.
3 4 5 6 |
# File 'lib/IOSDeploy.rb', line 3 def initialize init = `which ios-deploy` puts "Missing ios-deploy" if init.length < 1 end |
Instance Method Details
#connected_devices ⇒ Object
8 9 10 11 12 |
# File 'lib/IOSDeploy.rb', line 8 def connected_devices devices = [] stdout = `system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\\1/p'` stdout.split("\n") end |
#install_apk(device, filename) ⇒ Object
22 23 24 25 |
# File 'lib/IOSDeploy.rb', line 22 def install_apk(device, filename) puts "Device Name : #{device}" puts `ios-deploy -i #{device} --bundle #{filename}` end |
#install_to_all_devices(filename) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/IOSDeploy.rb', line 14 def install_to_all_devices(filename) devices = connected_devices puts "Installing" devices.each do |d| install_apk(d, filename) end end |