Module: Appium::Core::Base::Device::FileManagement

Included in:
Bridge
Defined in:
lib/appium_lib_core/common/device/file_management.rb,
sig/lib/appium_lib_core/common/device/file_management.rbs

Instance Method Summary collapse

Instance Method Details

#executeObject

Parameters:

  • command (Symbol)
  • (Hash[untyped, untyped])
  • (Hash[untyped, untyped])

Returns:

  • (Object)


12
# File 'sig/lib/appium_lib_core/common/device/file_management.rbs', line 12

def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped

#pull_file(path) ⇒ Object

Parameters:

  • path (Object)

Returns:

  • (Object)


27
28
29
30
# File 'lib/appium_lib_core/common/device/file_management.rb', line 27

def pull_file(path)
  data = execute :pull_file, {}, path: path
  Base64.decode64 data
end

#pull_folder(path) ⇒ Object

Parameters:

  • path (Object)

Returns:

  • (Object)


32
33
34
35
# File 'lib/appium_lib_core/common/device/file_management.rb', line 32

def pull_folder(path)
  data = execute :pull_folder, {}, path: path
  Base64.decode64 data
end

#push_file(path, filedata) ⇒ Object

Parameters:

  • path (Object)
  • filedata (Object)

Returns:

  • (Object)


22
23
24
25
# File 'lib/appium_lib_core/common/device/file_management.rb', line 22

def push_file(path, filedata)
  encoded_data = Base64.strict_encode64 filedata
  execute :push_file, {}, path: path, data: encoded_data
end