class GENYMOTION::DeviceManager
Public Class Methods
adb_devices()
click to toggle source
# File lib/genymotion/emulator.rb, line 18 def adb_devices `adb devices | tail -n +2 | awk '{print $1}'`.split end
all_devices_operational?()
click to toggle source
# File lib/genymotion/emulator.rb, line 31 def all_devices_operational? return false if adb_devices.nil? || adb_devices.empty? adb_devices.select { |d| !device_running?(d) }.empty? end
device_ids()
click to toggle source
# File lib/genymotion/emulator.rb, line 4 def device_ids `VBoxManage list vms | awk '{print $(NF)}' | sed 's/[{}]//g'`.split end
device_running?(device)
click to toggle source
# File lib/genymotion/emulator.rb, line 22 def device_running?(device) `adb -s #{device} shell getprop sys.boot_completed`.to_i == 1 end
devices()
click to toggle source
# File lib/genymotion/emulator.rb, line 8 def devices `VBoxManage list vms` end
kill_all()
click to toggle source
# File lib/genymotion/emulator.rb, line 26 def kill_all `ps -ef | grep '[p]layer' | awk '{print $2}' | xargs kill` `ps -ef | grep '[V]BoxHeadless' | awk '{print $2}' | xargs kill` end
launch(device)
click to toggle source
# File lib/genymotion/emulator.rb, line 12 def launch(device) p "launching #{device}" player = GENYMOTION.player_app.nil? ? '/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS/player' : GENYMOTION.player_app `#{player} --vm-name #{device} &` end