Reinvent The Wheel

Round is nice, but we can do better!

FireMonkeyLogo

RAD Studio XE2 – Setting it up for a Mac (step-by-step illustrated guide)

| 48 Comments

With Delphi XE2 now available for everyone to enjoy, I figured it’s time I start providing some useful information to help you make the most of it!

One of the primary new features of XE2 is the ability to produce MacOSX applications, and to do that, there are additional steps you must take in order to prepare both your Windows development system, and your MacOSX deployment/testing system for this task.

This document makes the following assumptions:

  1. You’ve installed Delphi (or RAD Studio) XE2 on a Windows 64bit system
  2. You’ve installed Delphi (or RAD Studio) XE2 to the default paths

So you’ve just installed Delphi (or RAD Studio) XE2… congratulations and welcome to the new and exciting world of cross-platform Delphi development!

Still, you’re not quite ready to start deploying your applications to your MacOSX machine just yet! Fear not, however, as the remaining steps should take you just a few additional minutes and you’ll be good to go!

On your Windows 64bit deployment/testing machine

  • Open Windows Explorer (Flag+E)
  • Go to C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\PAServer on your Development system.
  • Copy setup_paserver.zip over to your MacOSX device. You can do this any way you like: Share a folder on your PC and copy it from the Mac, place the file on a Mac-compatible USB flash drive and copy it that way…. whatever works best for you!

NOTE: The remaining steps in this section are only necessary if you’re running Delphi (or RAD Studio) XE2 on a 32bit system, and wish to deploy/debug 64bit Windows applications. If you’re developing on 64bit Windows, skip to the MacOSX section!

  • Copy setup_paserver.exe to your 64bit Windows deployment/testing machine (again, via network or whatever method works best for you)
  • Run setup_paserver.exe on your 64bit Windows deployment/testing machine (IMPORTANT NOTE: Should either the setup_paserver.zip or setup_paserver.exe files be missing, you should contact Embarcadero support as something has gone wrong with your XE2 installation!)
PAServer Windows Setup (Step 1)

PAServer Windows Setup (Step 1)

  • Press OK
PAServer Setup Windows (Step 2)

PAServer Windows Setup (Step 2)

  • Press Next
PAServer Windows Setup (Step 3)

PAServer Windows Setup (Step 3)

  • Select “I accept the terms of the License Agreement” and press Next
PAServer Windows Setup (Step 4)

PAServer Windows Setup (Step 4)

  • Press Next
PAServer Windows Setup (Step 5)

PAServer Windows Setup (Step 5)

  • Press Install
PAServer Windows Setup (Step 6)

PAServer Windows Setup (Step 6)

  •  Wait for the process to finish (could be anything from a minute or longer)
PAServer Windows Setup (Step 7)

PAServer Windows Setup (Step 7)

  • Press Done

On your MacOSX deployment/debugging machine

  • In Finder, locate the Folder into which you placed setup_paserver.zip, and Double-Click on the zip file.
PAServer MacOSX Setup (Step 1)

PAServer MacOSX Setup (Step 1)

  • Double-Click on the file named setup_paserver (noting the absence of .zip) to begin the PAServer setup on your MacOSX system.
PAServer Mac Setup (Step 2)

PAServer Mac Setup (Step 2)

  • Press OK
PAServer Mac Setup (Step 3)

PAServer Mac Setup (Step 3)

  • Press Next
PAServer Mac Setup (Step 4)

PAServer Mac Setup (Step 4)

  • Select “I accept the terms of the License Agreement” and press Next
PAServer Mac Setup (Step 5)

PAServer Mac Setup (Step 5)

  • Press Next (Note: This guide presumes that you’re installing PAServer on your MacOSX machine using the default location. If you elect to install to a different location, you will need to accommodate for that in future portions of this guide!)
PAServer Mac Setup (Step 6)

PAServer Mac Setup (Step 6)

  • Press Install (Remember: the installation process can take anything from a few seconds to several minutes)
PAServer Mac Setup (Step 7)

PAServer Mac Setup (Step 7)

  • Press Done
  • Go back to Finder, and navigate to “/Users/%username%/Applications/Embarcadero/PAServer” (substitute %username% for your MacOSX account username)
PAServer Mac Setup (Step 8)

PAServer Mac Setup (Step 8)

  • To run PAServer on your Mac (which is necessary to deploy and debug Delphi applications for the OSX platform), you can simply Double-Click on the paserver Application file
PAServer Mac Setup (Step 9)

PAServer Mac Setup (Step 9)

  • Simply enter a good password and press the Enter/Return Key

You can also create a Desktop/Dock shortcut to the paserver application to make it easier to run on demand…. or, if you’re clever…..

Make PAServer start automatically on your Mac when you switch it on (or log in)

  • Since you already have Finder open in the “/Users/%username%/Applications/Embarcadero/PAServer” folder…
  • Bring up Context Menu (by doing Control+Click) on the paserver.command file
  • Go to Open With and click TextEdit
PAServer Autorun At Startup/Login (Step 1-3)

PAServer Autorun At Startup/Login (Step 1-3)

  •  Modify the second line so that it resembles the following:
    “/Users/%username%/Applications/Embarcadero/PAServer/paserver” -password=S0m3Gr8tP455w0rd
    Including quotes, and remembering to substitute %username% with your MacOSX user account name! Essentially you’re just adding -password=… to the end of the line!
PAServer Autorun At Startup/Login (Step 4)

PAServer Autorun At Startup/Login (Step 4)

  • Save the file (using Command+S) and then Quit TextExit
  • Open System Preferences, select Users & Groups, then press the Login Items button.
  • Press the + button to add a new item to your login group
  • Locate “/Users/%username%/Applications/Embarcadero/PAServer/paserver.command” and press Add.
  • Tick the box (in the Hide column) corresponding to your paserver.command entry
PAServer Autorun At Startup/Login (Step 5)

PAServer Autorun At Startup/Login (Step 5)

PAServer will now automatically start (and hide itself) whenever you log in to your Mac, eliminating the annoyance of forgetting to start it before attempting to deploy/debug a Delphi application to the OSX platform.

Deploying your first FireMonkey application to your MacOSX machine

  • Open or create your FireMonkey project
  • On the Project Manager, you will need to Right-Click on Target Platforms, click Add Platform, and select OS X from the list, followed by clicking OK
  • Right-click on the OS X entry under Target Platforms on the Project Manager and click Assign Remote Profile
  • Click Add…
  • Enter Profile name
XE2 MacOSX FireMonkey Application Deployment (Step 1)

XE2 MacOSX FireMonkey Application Deployment (Step 1)

  • Click Next >>
  • Enter the Host name (or IP Address) of your MacOSX machine, and your Password as specified for PAServer on your Mac.
XE2 MacOSX FireMonkey Application Deployment (Step 2)

XE2 MacOSX FireMonkey Application Deployment (Step 2)

  • You may use Test Connection to ensure that your details are correct
  • Click Next >>, followed by Finish
  • Select your new Remote Profile from the list (e.g. My Mac Device as per the screenshot for Step 1) and click OK

That’s it! Your profile will be used for all MacOSX deployments by default (unless you specify a different profile for specific projects). Pressing F9 will deploy your application to your MacOSX machine (presuming you have selected the OS X entry in Target Platforms on the Project Manager), and you’ll be able to debug your application from Delphi whilst it is running on your Mac!

Just because pictures speak louder than words…

FireMonkey 3D GUI Demo on OSX Lion

FireMonkey 3D GUI Demo on OSX Lion

You can find the official PAServer documentation on Embarcadero’s Documentation Wiki.

Author: Simon J Stuart

Automation and Productivity Systems Specialist, Author of various Components, Libraries and Tools for Embarcadero Delphi, Embarcadero Technology Partner, Founder and CEO of LaKraven Studios Ltd, Father of 2 (+ 2 dogs), Credited Technical Editor, Published Technical Author, Seeker of peace!

48 Comments

  1. Hi,
    nice tutorial.
    however, you don’t need to run the pa_server.exe on your development machine. You need this, if your development machine is 32bit. then you install the pa-server on a 64bit machine to remote debug your win-64bit app.

  2. Nice article. I didn’t have time to play with XE2 yet but I’m very interested to see that and try it for myself. I’m especially wondering about screen size and scrollbars between native win/mac and IPad or IPhone: does the interface scale to be exactly as designed ? Are scrollbars introduced over a certain form size ? Hopefully I’ll have time soon ;)
    On a side note, you might consider using 7capture for your Windows screen-shots as they are not as nice as the Mac ones: http://www.7capture.com

  3. Everyone is showing that Delphi can do basic controls in MAC but what about the main thing, how does it do with Cocoa, is there any example how to use the OSX API or the iOS API, using the camera, the accelerometer, copying a file …

    • At this time, XE2 does not provide any Cocoa libs, however you should be able (theoretically at least) to produce your own Cocoa lib for Delphi if you really can’t live without it. Personally I don’t see the need for it!

      • As I understand the Cocoa & CocoaTouch is the API for OS X and iOS, how can I access the device hardwares like camera and so or at least can you show me how I can copy a file using XE2 without using the Cocoa? I don’t see how you can’t see the need for it.

      • Yikes. See XE2 wiki:

        http://docwiki.embarcadero.com/RADStudio/en/Mac_OS_X_Application_Development#Mac_Objective-C_Frameworks

        “Cocoa” includes AppKit and Foundation frameworks, both of which are available.

        One glaring omission is no Webkit framework – this provides Webview class, which can be used for Web browsing as well as rich text editing.

        Thanks.

        -Phil

        • Funny you should mention WebKit….

          I haven’t announced yet but I’ve been developing a WebKit library for Delphi (Win32, Win64, OSX) for the last several months! It’s been slow going (particularly WebKit on Windows, which is a freaking nightmare), but I suppose I could always just open the project up and let everyone chip in!

          • In iOS, UIWebView is part of the core UIKit framework, but in OS X, WebView is in its own WebKit framework. I think this indicates its increasing importance. Still, for it to be missing from the OS X units is quite odd – this is one of the first frameworks after AppKit and Foundation that programmers often use since it also support rich text editing.

            Embarc has made a good start with these dozen or so frameworks, although there’s about 60 more or so and if you need one of the others, nothing else will do.

            Despite what the XE2 wiki says, several of these are not ObjC frameworks, but just plain C libraries. I haven’t looked at the header files for all of them, but I would guess that’s the case for most of the frameworks that have “Core” in the name.

            What I can’t find is any information about which of the 39 frameworks in iOS 4.3 are available. Unfortunately I don’t have XE2 so I can’t determine this for myself. But the almost complete lack of information about iOS development with XE2 is pretty breathtaking.

            Thanks.

            -Phil

          • That’s a very good question… and yes, I totally agree that the documentation from EMB is sorely lacking! Since I have access to do so, I’m going to start contributing heavily to the XE2 wikidoc!

            As per the question, I’m going to send a few e-mails and see what I can find out in terms of assembling a “comprehensive list” of what is and is not available in terms of libs/apis/frameworks!

  4. Hi! Good article, but why you install paserver on win? IMHO-no need for this, only Mac should run PAServer))

    • Yes, I’ve made an error in this article…. you only need to install PAServer for Windows if you’re developing on a 32bit system, and want to remotely debug 64bit applications on a different machine! About to edit the article to reflect this info

  5. Hi , i followed all the steps , but i’m not able to run my app on MAC , when i take a look the PAServer * in terminal windows in MAC * i see this msg :
    Starting Platform Assistant Server on port 64211.
    >listen
    listen
    Process Control Server Started pid 34283 exe built Aug 23 2011
    sentinelFun 34287
    dyld: Library not loaded: @rpath/libcgunwind.1.0.dylib
    Referenced from /User/mac/Applications/Embarcadero/PAServer/scatch-dir/randy-my mac device/Project1.app/Contents/MacOS/Project1
    Reason: image not found

    So please is there any step i missed ? and how to fix this .

    many thanks

  6. I have the same problem as Randy. Which version on MacOSX do you use ?
    I have a macbook pro with MAcOSX 10.5.8

    Thanks

  7. Nice work. Looks like a good entry to submit to the Delphi Doc Wiki.

  8. Hi RBS and Randy, the problem is in the icon. It is not available. If you specify another icon for the app it will build and run

  9. Pingback: Esmamuljed Delphi XE2 Win32/64/OS X …nice ! « Ingmar Tammeväli

  10. Thanks Simon! This is very helpful.

  11. Pingback: Delphi XE2(Delphi 2012)的 Lite 系列下载 | 愚人笔记|www.foolcode.com

  12. Pingback: 03/09/11 | Новости FireMonkey

  13. I’ve setup the paserver on my OSX seem’s all right.

    And the “hello world” compiled succefull,

    But I got this message in my IDE’s output window:
    —-output window—————————————————————————–

    Project “C:\Users\gxy\Documents\RAD Studio\Projects\Project3.dproj” (Deploy target(s)):
    Target _DeployFiles:
    c:\program files\embarcadero\rad studio\9.0\bin\CodeGear.Deployment.targets : warning : Local file “” not found. Skipping deployment.
    Done building target “_DeployFiles” in project “Project3.dproj”.
    Done building project “Project3.dproj”.
    Build succeeded.
    c:\program files\embarcadero\rad studio\9.0\bin\CodeGear.Deployment.targets : warning : Local file “” not found. Skipping deployment.
    1 Warning(s)
    0 Error(s)
    Time Elapsed 00:00:00.00
    ——————————————————————————————

    Then I got the message in a popup dialog with a big red cross:
    ———message in dialog box—————————————-
    Unable to lunch process on ’192.168.0.177′ using the parameters from the ‘mba’ profile.

    The following error was returned:’Could find program, ‘/users/gxy/Applications/Embarcadero/Paserver/…
    ——————————————————————————-

    Anybody help?

  14. Are there any issues that might occur if I use a Mac mini running Lion OSX Server as opposed to the standard Lion OSX ?

  15. Pingback: Compilation sous Mac OSX | FireMonkey.fr

  16. Pingback: Compilation on Mac OSX | DelphiOnFire.com

  17. Dang it. Good guide, regrettably the paserver application does not work for me, because I appear to be running an older version of Mac OSX. I’m running 10.5.8 and it seems I need 10.6 or 10.7, according to the Firemonkey Datasheet (http://www.embarcadero.com/images/FireMonkey_datasheet.pdf). I guess I’m going to have to upgrade :)

  18. Don’t go through a lot of work to make FireMonkey work, as it still lacks basic functionality on the Mac, for example, there is no print function at all, and Embarcadero has no prediction of when it might exist. Unfortunately, if you expect FireMonkey to work as advertised, as being a fast way to generate applications for both platforms, at least for now you will be disappointed, as the increasing frustration on the developer forum shows.

    • They say every journey starts with a single step! Even as an Embarcadero Technology Partner, I’m going to honestly say I think the marketing team has not been so up-front about FireMonkey’s readiness.

      Is it ready to start experimenting with and planning for? Yes, it is!

      Is it ready to commit your resources (developers) to converting your existing projects over to, with the promise of absolute stability and performant suitability? At this moment, I say no…. but it will be in the not-so-distant future!

      Once MonkeyGroomer (for VCL) is available, however, the overhead on experimenting with existing projects being migrated from VCL to FireMonkey will certainly be low enough that we’ll all be able to at least BEGIN PREPARING for it!

  19. Using FM to build Delphi apps that will port over to OS X makes sense. Doing such a conversion for a quick-and-dirty port potentially reduces your time-to-market significantly. However, I don’t know many folks who use only the basic Delphi components, and avoid the ones that are Windows-specific. If you look at any decent app, it’s got TListViews, TTreeViews, and all sorts of library calls to file-system stuff that won’t convert over easily. Not to mention all of the various third-party component libs.

    (I’m a big fan of Raize Components, and I use them instead of the basic Delphi components in virtually every app I create. I like them because they expose just enough extra stuff that I usually want, without overloading me with tons of things I’ll never use — like what TMS tends to do. That said, almost every long-time Delphi developer I’ve met seems to have his/her own favorite library that they use whenever they can. Some libs are built on the same TCustomXxxx layers as common Delphi components, while others are rebuilt from the ground-up. Either way, the fact that so many component vendors are hanging back and “studying the market” before deciding what to do as far as FM support goes, well … it makes me a bit nervous. FM right now is like what the components were like in Delphi 1. There’s a ways to go before FM is going to be really viable for both Windows and OS X apps.)

    As far as iOS goes, I think porting existing Delphi apps over is not very smart. I’ve been reading a couple of books on designing for the iPad, and I’m leaning increasingly in the direction that simply porting a typical Delphi app over to iOS is not going to result in a very interesting app, especially for small-screen devices like iPhones and iPods.

    Even with iPads, the layouts of common Windows idioms like menus and toolbars aren’t well-designed for use with fingers as pointing devices. The navigation mechanisms need to be completely re-designed for best results. And from what I can tell after using my iPad for a few months, even pop-up dialog boxes and overlaid forms that are commonly used in Windows apps don’t “feel right” in the iPad environment.

  20. “Available to everyone”?! Have you not seen the price they put on it? Ouch!

  21. Great, wonderful guide, thanks very much.

  22. is it possibile to deploy apps on iPad 2 ? I’ve it since 1 week and I’m not familiar with OsX can anyone help me ?

    best regards

  23. I installed without problems.

    Thanks a lot.

  24. Simon a question, i tried run a simple form with a sqlconnection, and got the error:

    [DCC Fatal Error] Unit1.pas(8): F1026 File not found: ‘Data.DBXMSSQL.dcu’ (unit scope “Data” indicates Win64, OSX32, Win32 only)

    Do I need transfer all dcu to macOS? if yes, what it is the path?

    • I have not encountered this issue. Presumably this is occuring on compile…

      What platform are you building for? Presumably OSX, but I want to be sure.

      The error suggests that Delphi’s Search Paths/Library Paths are incorrect. You can check these in Tools > Options > Delphi Options > Library > Selected Platform = “OS X”

  25. Can one run XE under Parallels and target the OSX on the host machine rather than hitting an external Mac?

Leave a Reply

Required fields are marked *.

*


*