This guide is written on macOS Monterey (v12.3).
Here are instructions on setting up & running the most barebones app possible on macOS. There are probably better ways to do this, but here’s one way that works for me.
- Download & install the SDK via https://play.date/dev/
- Update your
~/.zshrcfile with the following line:
Obviously you want to replace “rex” with your username.
- Create a new folder for your project (anywhere)
- Create a VS Code folder & settings file
- Put the following into your new settings.json file. Make sure to replace the 2 instances of “rex” with your username
"Lua.runtime.version": "Lua 5.4",
(Apologies for the formatting. WordPress & code doesn’t mix well). You can copy & paste above (and make sure to replace the 2 “rex”s)
- Create a simple file for your app
Copy the following into main.lua:
print "Hello world"
Obviously this code does not do very much. It’s super, super basic, but it compiles & runs!
- Install the following VS Code extensions (sumneko.lua, jep-a.lua-plus, and Orta.playdate)
- Run your app on the Playdate Simulator with VS Code.
Press Cmd + Shift + P and select & run [Run app in Playdate simulator]
- That’s it! Your app is now running on the Playdate sim. You can view print statements by using Window > Console.
For more comprehensive details, refer to the SDK documentation: https://sdk.play.date/1.10.0/
For the sample files discussed here, see repo: https://github.com/xta/playdate_hello_world