Module: Appium::Core::Mac2::Device

Extended by:
Forwardable
Defined in:
lib/appium_lib_core/mac2/device.rb,
lib/appium_lib_core/mac2/device/screen.rb

Defined Under Namespace

Modules: Screen

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(_mod) ⇒ Object



85
86
87
# File 'lib/appium_lib_core/mac2/device.rb', line 85

def extended(_mod)
  Screen.add_methods
end

Instance Method Details

#start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', file_field_name: nil, form_fields: nil, headers: nil, force_restart: nil, fps: nil, preset: nil, video_filter: nil, enable_capture_clicks: nil, enable_cursor_capture: nil, device_id: nil) ⇒ Object

Record the display of devices running iOS Simulator since Xcode 9 or real devices since iOS 11 (ffmpeg utility is required: ‘brew install ffmpeg’). We would recommend to play the video by VLC or Mplayer if you can not play the video with other video players.

Examples:


@driver.start_recording_screen
@driver.start_recording_screen fps: 30, enable_cursor_capture: true

Parameters:

  • remote_path (String) (defaults to: nil)

    The path to the remote location, where the resulting video should be uploaded. The following protocols are supported: http/https, ftp. Null or empty string value (the default setting) means the content of resulting file should be encoded as Base64 and passed as the endpount response value. An exception will be thrown if the generated media file is too big to fit into the available process memory. This option only has an effect if there is screen recording process in progreess and forceRestart parameter is not set to true.

  • user (String) (defaults to: nil)

    The name of the user for the remote authentication.

  • pass (String) (defaults to: nil)

    The password for the remote authentication.

  • method (String) (defaults to: 'PUT')

    The http multipart upload method name. The ‘PUT’ one is used by default.

  • file_field_name (String) (defaults to: nil)

    The name of the form field containing the binary payload in multipart/form-data requests since Appium 1.18.0. Defaults to ‘file’.

  • form_fields (Array<Hash, Array<String>>) (defaults to: nil)

    The form fields mapping in multipart/form-data requests since Appium 1.18.0. If any entry has the same key in this mapping, then it is going to be ignored.

  • headers (Hash) (defaults to: nil)

    The additional headers in multipart/form-data requests since Appium 1.18.0.

  • force_restart (Boolean) (defaults to: nil)

    Whether to try to catch and upload/return the currently running screen recording (false, the default setting on server) or ignore the result of it and start a new recording immediately (true).

  • fps (integer) (defaults to: nil)

    The count of frames per second in the resulting video. Increasing fps value also increases the size of the resulting video file and the CPU usage. The default value is 15.

  • preset (String) (defaults to: nil)

    A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Read trac.ffmpeg.org/wiki/Encode/H.264 for more details.

  • enable_cursor_capture (Boolean) (defaults to: nil)

    Whether to capture the click gestures while recording the screen. Disabled by default.

  • enable_capture_clicks (Boolean) (defaults to: nil)

    Recording time. 180 seconds is by default.

  • video_filter (String) (defaults to: nil)

    The video filter spec to apply for ffmpeg. See trac.ffmpeg.org/wiki/FilteringGuide for more details on the possible values. Example: Set it to scale=ifnot(gte(iw,1024),iw,1024):-2 in order to limit the video width to 1024px. The height will be adjusted automatically to match the actual screen aspect ratio.

  • device_id (integer) (defaults to: nil)

    Screen device index to use for the recording. The list of available devices could be retrieved using ffmpeg -f avfoundation -list_devices true -i “” command. This option is mandatory and must be always provided.

  • time_limit (String)

    The maximum recording time. The default value is 600 seconds (10 minutes). The minimum time resolution unit is one second.

Since:

  • Appium 1.20.0



# File 'lib/appium_lib_core/mac2/device.rb', line 25