Class: EmuCtl::ADB

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

Class Method Summary collapse

Class Method Details

.boot_complete?Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/emu_ctl/adb.rb', line 10

def self.boot_complete?
  _, stdout, stderr = Open3.popen3('adb shell getprop dev.bootcomplete')
  return stderr.gets.nil?
end

.devicesObject



3
4
5
6
7
8
# File 'lib/emu_ctl/adb.rb', line 3

def self.devices
  _, stdout, _ = Open3.popen3('adb devices')
  lines = []
  stdout.each_line { |l| lines.push(l) }
  lines.join
end

.unlock_emulatorObject



15
16
17
18
# File 'lib/emu_ctl/adb.rb', line 15

def self.unlock_emulator
  system 'adb shell input keyevent 82'
  system 'adb shell input keyevent 4'
end