Class: IOSDeploy

Inherits:
Object
  • Object
show all
Defined in:
lib/IOSDeploy.rb

Instance Method Summary collapse

Constructor Details

#initializeIOSDeploy

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_devicesObject



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