def setup_signal_handler(ios_pid = nil, android_pid = nil)
      Signal.trap('INT') do
        Process.kill('INT', ios_pid) unless ios_pid.nil?
        Process.kill('INT', android_pid) unless android_pid.nil?

        # Kill any existing Appium and Selenium processes
        kill_process 'appium'
        kill_process 'selenium'

        # Terminate ourself
        exit 1
      end
    end
def setup_signal_handler(ios_pid = nil, android_pid = nil)
      Signal.trap('INT') do
        Process.kill('INT', ios_pid) unless ios_pid.nil?
        Process.kill('INT', android_pid) unless android_pid.nil?

        # Kill any existing Appium and Selenium processes
        kill_process 'appium'
        kill_process 'selenium'

        # Terminate ourself
        exit 1
      end
    end
Define a signal handler for SIGINT