Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Tools/dotnet-dsrouter/DiagnosticsServerRouterCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public async Task<int> RunIpcServerIOSSimulatorRouter(CancellationToken token, i
{
if (info || ParseLogLevel(verbose) <= LogLevel.Information)
{
logRouterUsageInfo("ios simulator", "127.0.0.1:9000", true, parentProcess);
logRouterUsageInfo("ios simulator", "127.0.0.1", "9000", true, parentProcess);
}

return await RunIpcServerTcpClientRouter(token, "", "127.0.0.1:9000", runtimeTimeout, verbose, "").ConfigureAwait(false);
Expand All @@ -371,7 +371,7 @@ public async Task<int> RunIpcServerIOSRouter(CancellationToken token, int runtim
{
if (info || ParseLogLevel(verbose) <= LogLevel.Information)
{
logRouterUsageInfo("ios device", "127.0.0.1:9000", true, parentProcess);
logRouterUsageInfo("ios device", "127.0.0.1", "9000", true, parentProcess);
}

return await RunIpcServerTcpClientRouter(token, "", "127.0.0.1:9000", runtimeTimeout, verbose, "iOS").ConfigureAwait(false);
Expand All @@ -381,7 +381,7 @@ public async Task<int> RunIpcServerAndroidEmulatorRouter(CancellationToken token
{
if (info || ParseLogLevel(verbose) <= LogLevel.Information)
{
logRouterUsageInfo("android emulator", "10.0.2.2:9000", false, parentProcess);
logRouterUsageInfo("android emulator", "10.0.2.2", "9000", false, parentProcess);
}

return await RunIpcServerTcpServerRouter(token, "", "127.0.0.1:9000", runtimeTimeout, verbose, "").ConfigureAwait(false);
Expand All @@ -391,7 +391,7 @@ public async Task<int> RunIpcServerAndroidRouter(CancellationToken token, int ru
{
if (info || ParseLogLevel(verbose) <= LogLevel.Information)
{
logRouterUsageInfo("android device", "127.0.0.1:9000", false, parentProcess);
logRouterUsageInfo("android device", "127.0.0.1", "9000", false, parentProcess);
}

return await RunIpcServerTcpServerRouter(token, "", "127.0.0.1:9001", runtimeTimeout, verbose, "Android").ConfigureAwait(false);
Expand Down Expand Up @@ -501,19 +501,19 @@ private static LogLevel ParseLogLevel(string verbose)
return logLevel;
}

private static void logRouterUsageInfo(string deviceName, string deviceTcpIpAddress, bool deviceListenMode, string parentProcess)
private static void logRouterUsageInfo(string deviceName, string deviceTcpIpAddress, string deviceTcpIpPort, bool deviceListenMode, string parentProcess)
{
StringBuilder message = new();

string listenMode = deviceListenMode ? "listen" : "connect";
int pid = Process.GetCurrentProcess().Id;

message.AppendLine($"How to connect current dotnet-dsrouter pid={pid} with {deviceName} and diagnostics tooling.");
message.AppendLine($"Start an application on {deviceName} with ONE of the following environment variables set:");
message.AppendLine($"Build and run your application on {deviceName} such as:");
message.AppendLine("[Default Tracing]");
message.AppendLine($"DOTNET_DiagnosticPorts={deviceTcpIpAddress},nosuspend,{listenMode}");
message.AppendLine($"dotnet build -t:Run -c Release -p:DiagnosticAddress={deviceTcpIpAddress} -p:DiagnosticPort={deviceTcpIpPort} -p:DiagnosticSuspend=false -p:DiagnosticListenMode={listenMode}");
message.AppendLine("[Startup Tracing]");
message.AppendLine($"DOTNET_DiagnosticPorts={deviceTcpIpAddress},suspend,{listenMode}");
message.AppendLine($"dotnet build -t:Run -c Release -p:DiagnosticAddress={deviceTcpIpAddress} -p:DiagnosticPort={deviceTcpIpPort} -p:DiagnosticSuspend=true -p:DiagnosticListenMode={listenMode}");
if (string.IsNullOrEmpty(parentProcess))
{
message.AppendLine($"Run diagnotic tool connecting application on {deviceName} through dotnet-dsrouter pid={pid}:");
Expand Down