Sha256: 90a5373979f581902bb0ba69ad739f6519200fe44638b88f20f28e8d3fa8e2d1
Contents?: true
Size: 1.37 KB
Versions: 1
Compression:
Stored size: 1.37 KB
Contents
require 'di' require 'ADB' require 'stf/client' require 'stf/log/log' module Stf class StopDebugSessionInteractor include Log include ADB def execute(remote_connect_url) remote_devices = DI[:stf].get_user_devices device = remote_devices.find {|d| d.remoteConnect == true && DI[:device_enhancer].get_tunneled_remote_connect_url(d).eql?(remote_connect_url)} # try to disconnect anyway if DI[:connect_ios].connected_ios_devices.include? remote_connect_url DI[:connect_ios].disconnect() else execute_adb_with 30, "disconnect #{remote_connect_url}" end if device.nil? logger.error "Device #{remote_connect_url} is not available" return false end success = false 1..10.times do begin success = DI[:stf].stop_debug(device.serial) break if success rescue end logger.error 'Can\'t stop debug session. Retrying' end 1..10.times do begin success = DI[:stf].remove_device(device.serial) break if success rescue end logger.error 'Can\'t remove device from user devices. Retrying' end if success logger.info "Successfully removed #{remote_connect_url}" else logger.error "Error removing #{remote_connect_url}" end success end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
smartdust-client-1.2.0 | lib/stf/interactor/stop_debug_session_interactor.rb |