You've already forked lazarus-ccr
iphonelazext: changing run simulator to apples instruments utility. Updated the frames to use resources files, instead of the old include files
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4401 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
76
components/iphonelazext/tests/testlaunch.lpi
Normal file
76
components/iphonelazext/tests/testlaunch.lpi
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="testlaunch"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="testlaunch.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="testlaunch"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value=".."/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<SyntaxMode Value="Delphi"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
88
components/iphonelazext/tests/testlaunch.lpr
Normal file
88
components/iphonelazext/tests/testlaunch.lpr
Normal file
@ -0,0 +1,88 @@
|
||||
program testlaunch;
|
||||
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}cthreads,{$ENDIF}
|
||||
Classes, iphonesimctrl;
|
||||
|
||||
procedure PrintList;
|
||||
var
|
||||
lst : TList;
|
||||
i : integer;
|
||||
dev : TSimDevice;
|
||||
begin
|
||||
lst := TList.Create;
|
||||
try
|
||||
ListDevice(lst);
|
||||
for i:=0 to lst.Count-1 do begin
|
||||
dev := TSimDevice(lst[i]);
|
||||
writeln(dev.id,' ',dev.isavail,' ',dev.sdk,' ', dev.name,' ',dev.state);
|
||||
end;
|
||||
finally
|
||||
lst.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure RunDevice(const nm: string);
|
||||
begin
|
||||
RunSim(nm);
|
||||
end;
|
||||
|
||||
procedure RunApp(const appid: string);
|
||||
var
|
||||
res : string;
|
||||
pid : Integer;
|
||||
begin
|
||||
res:='';
|
||||
if not RunAppOnSim(appid, '', False, pid, res) then begin
|
||||
writeln('failed to run app');
|
||||
end else begin
|
||||
writeln('launching!');
|
||||
writeln('pid = ', pid);
|
||||
writeln('outstr: ');
|
||||
writeln(res);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure PrintHelp;
|
||||
begin
|
||||
writeln('testlaunch %action% [%parameters%]');
|
||||
writeln('action:');
|
||||
writeln(' list - list devices');
|
||||
writeln(' run %deviceid% - runs a simulator with specified id');
|
||||
writeln(' runapp %appid% - runs an application on booted device');
|
||||
end;
|
||||
|
||||
var
|
||||
act : string = '';
|
||||
|
||||
procedure ParseParam;
|
||||
begin
|
||||
if ParamCount=0 then Exit;
|
||||
act:=ParamStr(1);
|
||||
act:=lowercase(act);
|
||||
end;
|
||||
|
||||
begin
|
||||
if ParamCount=0 then begin
|
||||
PrintHelp;
|
||||
exit;
|
||||
end;
|
||||
ParseParam;
|
||||
if act='list' then PrintList
|
||||
else if act='run' then begin
|
||||
if ParamCount=1 then begin
|
||||
writeln('Please specify deviceid');
|
||||
Exit;
|
||||
end;
|
||||
RunDevice(ParamStr(2));
|
||||
end else if act='runapp' then begin
|
||||
if ParamCount=1 then begin
|
||||
writeln('Please specify application id to run');
|
||||
Exit;
|
||||
end;
|
||||
RunApp(ParamStr(2));
|
||||
end;
|
||||
end.
|
||||
|
Reference in New Issue
Block a user