Skip to content

Commit 7f4ba12

Browse files
authored
Add "-ip <device_ip>" command line option
This feature aims to help managing connections to a large amount of profiling targets. If target's ip is known (e.g. via adb), it is easier to launch the profiler with this ip from command line, instead of looking for it in a list or entering manually.
1 parent 5971b40 commit 7f4ba12

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

gui/daProfiler/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.0.14.0")]
55-
[assembly: AssemblyFileVersion("1.0.14.0")]
54+
[assembly: AssemblyVersion("1.0.15.0")]
55+
[assembly: AssemblyFileVersion("1.0.15.0")]

gui/daProfiler/ViewModels/AddressBarViewModel.cs

+11
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ public void Load()
151151

152152
AddEditableItem();
153153

154+
string[] commandLineArgs = Environment.GetCommandLineArgs();
155+
int ipArgIndex = Array.IndexOf(commandLineArgs, "-ip");
156+
int ipValueArgIndex = ipArgIndex + 1;
157+
if (ipValueArgIndex > 0 && ipValueArgIndex < commandLineArgs.Length)
158+
{
159+
ConnectionVM commandLineConnection = new ConnectionVM() { Name = "command_line", Address = commandLineArgs[ipValueArgIndex], CanDelete = false };
160+
Connections.Add(commandLineConnection);
161+
Select(commandLineConnection.GetConnection());
162+
return;
163+
}
164+
154165
Select(Settings.LocalSettings.Data.LastConnection);
155166
}
156167

0 commit comments

Comments
 (0)