Class: Calabash::Extras::AndroidRunner

Inherits:
Object
  • Object
show all
Includes:
Android::Operations
Defined in:
lib/calabash-extras/android_runner.rb

Defined Under Namespace

Classes: Emulator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ AndroidRunner

Returns a new instance of AndroidRunner.



14
15
16
# File 'lib/calabash-extras/android_runner.rb', line 14

def initialize(config)
  @config = config
end

Instance Attribute Details

#default_deviceObject (readonly)

Returns the value of attribute default_device.



12
13
14
# File 'lib/calabash-extras/android_runner.rb', line 12

def default_device
  @default_device
end

Instance Method Details

#reinstall_appObject



29
30
31
32
33
34
# File 'lib/calabash-extras/android_runner.rb', line 29

def reinstall_app
  reinstall_apps
  sleep 1
  start_test_server_in_background
  reinstall_hook if defined? self.reinstall_hook
end

#startObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/calabash-extras/android_runner.rb', line 18

def start
  load Gem.bin_path('calabash-android', 'calabash-android')

  path = File.expand_path(@config['apk_path'])

  Emulator.launch(@config['emulator']) if @config['start_emulator']

  build_test_server_if_needed(path)
  set_default_device(Device.new(self, @config['name'], nil, path, test_server_path(path)))
end