delphidelphi-xe4

How deploy a OSX or IOS Delphi project from the Command line?


I'm building my Delphi Apps using a script like

call "C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\bin\rsvars.bat"
msbuild.exe "C:\Projects\Foo\Bar.dproj"

And now I want add an option to deploy the application to an OSX (or IOS) system modifing such script, so is possible deploy a OSX or IOS Delphi project from the Command line?


Solution

  • To deploy your application to a remote location , you must use the paclient.exe (Platform Assistant Client Application) tool.

    In order to get the passed parameters Build and Run you project from RAD Studio and then check the Build tab of the message windows of the IDE.

    Check the next image for a OSX Application using a profile called Local

    enter image description here

    From here you can extract all the parameters passed to the paclient.exe

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --Clean="Project7.app,C:\Users\RRUZ\Desktop\Test Deploy_@emb_.tmp"

    the _@emb_.tmp file is a temp file created by the ide that contains all the files to deploy in this case the content is like so

    Project7.app\Contents\MacOS\Project7.rsm
    Project7.app\Contents\Entitlements.plist
    Project7.app\Contents\MacOS\libcgunwind.1.0.dylib
    Project7.app\Contents\MacOS\Project7
    Project7.app\Contents\Resources\Project7.icns
    

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --put="OSX32\Debug\Project7.info.plist,Project7.app\Contents\,1,Info.plist" Local

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --put="c:\program files (x86)\embarcadero\rad studio\11.0\Redist\osx32\libcgunwind.1.0.dylib,Project7.app\Contents\MacOS\,1,libcgunwind.1.0.dylib" Local

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --put="OSX32\Debug\Project7,Project7.app\Contents\MacOS\,1,Project7" Local

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --put="OSX32\Debug\Project7.rsm,Project7.app\Contents\MacOS\,1,Project7.rsm" Local

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --put="c:\program files (x86)\embarcadero\rad studio\11.0\bin\delphi_PROJECTICNS.icns,Project7.app\Contents\Resources\,1,Project7.icns" Local

    c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe --put="OSX32\Debug\Project7.entitlements,Project7.app\Contents\,1,Entitlements.plist" Local

    Final script

    Finally you can put all this in a script file like so

    call "C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\bin\rsvars.bat"
    MSBuild Project7.dproj 
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --Clean="Project7.app,C:\Users\RRUZ\Desktop\Test Deploy\files.txt"  
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --put="OSX32\Debug\Project7.info.plist,Project7.app\Contents\,1,Info.plist" Local 
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --put="c:\program files (x86)\embarcadero\rad studio\11.0\Redist\osx32\libcgunwind.1.0.dylib,Project7.app\Contents\MacOS\,1,libcgunwind.1.0.dylib" Local 
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --put="OSX32\Debug\Project7,Project7.app\Contents\MacOS\,1,Project7" Local 
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --put="OSX32\Debug\Project7.rsm,Project7.app\Contents\MacOS\,1,Project7.rsm" Local
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --put="c:\program files (x86)\embarcadero\rad studio\11.0\bin\delphi_PROJECTICNS.icns,Project7.app\Contents\Resources\,1,Project7.icns" Local 
    "c:\program files (x86)\embarcadero\rad studio\11.0\bin\paclient.exe" --put="OSX32\Debug\Project7.entitlements,Project7.app\Contents\,1,Entitlements.plist" Local 
    

    Note : Remember create a file with the file names of all the files to deploy , in this sample script is called files.txt, this file is use by the paclient to cleanup previus deployed files.