Module: Appium::Ios::Xcuitest::Command

Defined in:
lib/appium_lib/ios/xcuitest/command.rb

Instance Method Summary collapse

Instance Method Details

#start_logs_broadcast(syslog_file = 'syslog.log') ⇒ Object

Starts iOS syslog broadcast websocket

Examples:


start_logs_broadcast 'outputfile.log' #=> #<Appium::Android::Command::WsLogcat:...>

Parameters:

  • syslog_file (String) (defaults to: 'syslog.log')

    A file path to write messages from a syslog WebSocket client



33
34
35
36
37
38
# File 'lib/appium_lib/ios/xcuitest/command.rb', line 33

def start_logs_broadcast(syslog_file = 'syslog.log')
  @driver.execute_script 'mobile: startLogsBroadcast'

  socket_url = "ws://#{URI.parse(server_url).host}:#{@core.port}/ws/session/#{@driver.session_id}/appium/device/syslog"
  @logcat_client = ::Appium::Common::Command::WsLogcat.new(url: socket_url, output_file: syslog_file)
end

#stop_logs_broadcastObject

Stop iOS syslog broadcast websocket

Examples:


stop_logs_broadcast #=> nil


46
47
48
49
50
# File 'lib/appium_lib/ios/xcuitest/command.rb', line 46

def stop_logs_broadcast
  @logcat_client.close

  @driver.execute_script 'mobile: stopLogsBroadcast'
end