Method: Appium::Core::Ios::Xcuitest::Device#start_recording_screen

Defined in:
lib/appium_lib_core/ios/xcuitest/device.rb

#start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', file_field_name: nil, form_fields: nil, headers: nil, force_restart: nil, video_type: 'mjpeg', video_fps: nil, time_limit: '180', video_quality: nil, video_scale: nil, video_filters: nil, pixel_format: nil) ⇒ String

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 video_type: 'mjpeg', time_limit: '260'
@driver.start_recording_screen video_type: 'libx264', time_limit: '260' # Can get '.mp4' video

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).

  • video_type (String) (defaults to: 'mjpeg')

    The video codec type used for encoding of the be recorded screen capture. Execute ffmpeg -codecs in the terminal to see the list of supported video codecs. ‘mjpeg’ by default.

  • time_limit (String) (defaults to: '180')

    Recording time. 180 seconds is by default.

  • video_quality (String) (defaults to: nil)

    The video encoding quality (low, medium, high, photo - defaults to medium).

  • video_fps (String) (defaults to: nil)

    The Frames Per Second rate of the recorded video. Change this value if the resulting video is too slow or too fast. Defaults to 10. This can decrease the resulting file size.

  • video_filters (String) (defaults to: nil)
    • @since Appium 1.15.0

    The ffmpeg video filters to apply. These filters allow to scale, flip, rotate and do many other useful transformations on the source video stream. The format of the property must comply with ffmpeg.org/ffmpeg-filters.html e.g.: “rotate=90”

  • video_scale (String) (defaults to: nil)

    The scaling value to apply. Read trac.ffmpeg.org/wiki/Scaling for possible values. No scale is applied by default. tips: ffmpeg cannot capture video as libx264 if the video dimensions is not divisible by 2. Then, you can set this scale as scale=trunc(iw/2)*2:trunc(ih/2)*2

  • pixel_format (String) (defaults to: nil)

    Output pixel format. Run ffmpeg -pix_fmts to list possible values. For Quicktime compatibility, set to “yuv420p” along with videoType: “libx264”.

Returns:

  • (String)

    Base64 encoded content of the recorded media file or an empty string if the file has been successfully uploaded to a remote location (depends on the actual options)

Since:

  • Appium 1.9.1



# File 'lib/appium_lib_core/ios/xcuitest/device.rb', line 50