Module: Appium::Core::Base::Device::AppState

Included in:
Bridge::MJSONWP, Bridge::W3C
Defined in:
lib/appium_lib_core/common/device/app_state.rb

Constant Summary collapse

STATUS =
[
  :not_installed,                   # 0
  :not_running,                     # 1
  :running_in_background_suspended, # 2
  :running_in_background,           # 3
  :running_in_foreground            # 4
].freeze

Instance Method Summary collapse

Instance Method Details

#app_state(app_id) ⇒ Object


28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/appium_lib_core/common/device/app_state.rb', line 28

def app_state(app_id)
  # required: [['appId'], ['bundleId']]
  response = execute :app_state, {}, appId: app_id

  case response
  when 0, 1, 2, 3, 4
    STATUS[response]
  else
    ::Appium::Logger.debug("Unexpected status in app_state: #{response}")
    response
  end
end