-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAdbWirelessService.dpr
More file actions
49 lines (39 loc) · 928 Bytes
/
AdbWirelessService.dpr
File metadata and controls
49 lines (39 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
program AdbWirelessService;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
AWSMain in 'AWSMain.pas',
Winapi.Windows;
var
Main: TAWSMain;
ParamPort, ParamAdb: string;
Input: AnsiString;
begin
try
FindCmdLineSwitch('p', ParamPort, True);
FindCmdLineSwitch('a', ParamAdb, True);
if ParamAdb = '' then
ParamAdb := 'adb';
if ParamPort = '' then
ParamPort := '8555';
Writeln('adb wireless is runing');
Writeln(Format('port - %s', [ParamPort]));
Writeln(Format('adb - %s', [ParamAdb]));
Main := TAWSMain.Create;
try
Main.start(StrToIntDef(ParamPort, 8555), ParamAdb);
Writeln('please input your command:');
while True do
begin
Readln(Input);
WinExec(PAnsiChar(Input), SW_NORMAL);
end;
finally
Main.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.