Basically it's simple. Kind of.
Basically you're going to launch the "love" binary with the .love file as its first argument. The "love" binary is inside the love.app package. You can find it by right-clicking on the .app and "Show Contents". Then navigate to /Contents/MacOS. The love binary is in that folder.
ALTERNATIVELY: Assuming the love.app is in /Applications/, the path to the love binary below will be /Applications/love.app/Contents/MacOS/love.
Open a Terminal window and do two things. First drag the love binary to the Terminal window. Then drag the .love. The command should appear something like this:
Code: Select all
/Path/to/love.app/Contents/MacOS/love /Path/to/project.love
Press Enter/Return and it will launch. All "print()" calls will also print to this window as a bonus for debugging.
I created a run.command file to handle this for me. Basically you'd create a new plain text file and use this as the contents:
Code: Select all
#!/bin/bash
~/Documents/Projects/LÖVE/Apps/love.app/Contents/MacOS/love "${0%/*}"
Then rename it to run.command, place it in the same directory as your main.lua and make it Executable by using this command:
The strange string above with the $ and {} characters simply means it will pass the current folder (That the .command file is in) as the argument.
Don't worry if you think something might screw something up, these commands are safe. And you couldn't destroy anything without using sudo anyway.
Remember to replace /Path/to/ with the actual path. (Dragging and dropping is the easiest way to put a file path into a Terminal window without typing. Also see ALTERNATIVELY above.)
Now you can just double-click the .command file or assign it to a hotkey with a program or put it in your Dock and launch your project easily complete with debugging console. I set mine to Command+Shift+R.
Also: I'm not sure if the chmod program requires Xcode to be installed or not. If it does, there are probably other ways to make it executable.