I know that this is a bit of an older thread, but I ended up finding the answer to this for any future interested parties.
On
macOS, one must use the
open command to fire up an application bundle such as the YoYo Runner for your currently-installed GameMaker Studio 2 runtime. So, to give an example, I can open a second instance of my game by running the following in my zsh or bash shell on macOS ↝
Code:
open -n -a /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.2.5.378/mac/YoYo\ Runner.app --args -game "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/GameAssetsMac.zip"
I'll break down this command below ↝
- open is the command to open an application bundle on macOS.
- -n indicates that you would like to open a new, unique instance of the application bundle (as macOS will generally opt to only allow a single instance of an app to run at once).
- -a /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.2.5.378/mac/YoYo\ Runner.app provides the path to the YoYo Runner from whatever installed GameMaker Studio 2 runtime that I would like to use.
- --args tells the command that everything following should be passed as an argument to the specified app rather than to the open command itself.
- -game "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/GameAssetsMac.zip" provides the path to the actual game to run.
All of this can be pulled from the console output from GameMaker Studio 2. For example, look for output like the following when you run your game from the IDE (notice that I don't worry about any of the debug output paths – you can if you really need to, but you probably don't) ↝
Code:
/bin/bash DONE (0)
-n -a "/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.2.5.378/mac/YoYo Runner.app" --args -game "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/GameAssetsMac.zip" -debugoutput "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/debug.log" -output "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/debug.log"
Igor complete.
Starting...
If you want to make this easier on yourself, you can drop the following GML snippet somwhere in your project to have it output a command for you to copy-and-paste to the shell when run from the IDE. Note that you'll need to make
GMS2_RUNTIME a valid variable in your environment that holds the path to your installed GameMaker Studio 2 runtime's YoYo Runner app.
Code:
//
// Output one-liner that can be used to start a second instance of the game to the console.
//
show_debug_message("Second instance command ~>")
show_debug_message(
"\topen -n -a ${GMS2_RUNTIME} --args " +
parameter_string(0) +
" " + parameter_string(1)
)