private void Connect(IPAddress address, int port)
        {
            lock (_lock) {
                _debuggeeKilled = false;

                var args0 = new Mono.Debugging.Soft.SoftDebuggerConnectArgs(string.Empty, address, port)
                {
                    MaxConnectionAttempts         = MAX_CONNECTION_ATTEMPTS,
                    TimeBetweenConnectionAttempts = CONNECTION_ATTEMPT_INTERVAL
                };

                _session.Run(new Mono.Debugging.Soft.SoftDebuggerStartInfo(args0), _debuggerSessionOptions);

                _debuggeeExecuting = true;
            }
        }
示例#2
0
        private void Connect(XamarinOptions options, IPAddress address, int port)
        {
            IDEManager.Shared.StartMonitoring();
            lock (_lock) {
                _debuggeeKilled = false;

                Mono.Debugging.Soft.SoftDebuggerStartArgs args = null;
                if (options.ProjectType == ProjectType.Android)
                {
                    args = new Mono.Debugging.Soft.SoftDebuggerConnectArgs(options.AppName, address, port)
                    {
                        MaxConnectionAttempts         = MAX_CONNECTION_ATTEMPTS,
                        TimeBetweenConnectionAttempts = CONNECTION_ATTEMPT_INTERVAL,
                    };
                }
                else if (options.ProjectType == ProjectType.iOS)
                {
                    if (options.IsSim)
                    {
                        args = new IPhoneSimulatorDebuggerArgs(options.AppName, new IPhoneTcpCommandConnection(IPAddress.Loopback, port))
                        {
                            MaxConnectionAttempts = 10
                        }
                    }
                    ;
                    else
                    {
                        args = new Mono.Debugging.Soft.SoftDebuggerListenArgs(options.AppName, IPAddress.Loopback, port);
                    }
                }

                Console.WriteLine("Listening for debugger!");
                _session.Run(new Mono.Debugging.Soft.SoftDebuggerStartInfo(args), _debuggerSessionOptions);

                _debuggeeExecuting = true;
            }
        }