OS X and RubyMotion, Finishing Up11 Nov 2013
There is something I neglected to cover in a previous blog post, Building an OS X App With RubyMotion. Once you’ve written the OS X app, where do you find the executable, and how do you add it to the
Applications folder on the Mac?
Long-time Mac enthusiasts may already know how to do this. The information is included here for completeness.
Find, Drag, and Drop
First thing to note: A Mac app named [random-app].app is actually a directory, even though it appears to be a file when viewed in the
Applications folder. If you’re curious, right-click on any app in the
Applications folder and choose
Show Package Contents from the speed menu.
After compilation, RubyMotion puts all of the executables in the app’s
build/ directory. Using Finder, drag the folder named
[your-app-name].app into the
Or, if you prefer the command line…
$ cd [root-directory-of-your-app] $ cp build/MacOSX-10.8-Development/[your-app-name].app /Applications $
It doesn’t really matter whether we copy the file or move it. RubyMotion creates a new one with every build, when we type
Launch at Login
I want the EjectDisks utility to be always available, so it would be good to have it launch automatically at login. That behavior is managed in the
Users and Groups preference pane, shown below:
+ sign, navigate to the app you want to launch at login time (in this case, EjectDisks) and select it. Done.