Add command to install PDX on device

I'd like to have have an option to install a PDX via command line.

I can compile a project and run it in the Simulator via the command line via:

pdc src game.pdx
PlaydateSimulator game.pdx

But then I must use Device > Install Game To device for the final step. The most frustrating bit is that the folder selection window doesn't always remember my last folder.

This isn't terrible, but it does make on-device iteration longer :confused:

1 Like

If a game is running in the Simulator you can press Cmd+U to upload the game to the device. The device needs to be unlocked, of course. This is how I install most things.

https://sdk.play.date/inside-playdate/#_running_your_game_on_playdate_hardware

A command line option that can be integrated in the build process world be useful.

1 Like

Oh nice! That shortcut is certainly handy. Would be nice to have this documented, or show up in the menu item like other shortcuts.

EDIT: hmm...this doesn't seem to work on Windows. I tried both CTRL+U and ALT+U :frowning:

When you plug in an unlocked device the Simulator (at least on Mac) get a new toolbar icon. I believe I learned the keyboard shortcut from the menu on that button.

I will add a hot key to the Windows Sim for the next release, thanks for pointing that out.

2 Likes

Awesome thank you! That will definitely help a ton🀘

A CLI option would still be preferable - is that something that will be added too?

@SHiLLySiT Adding it directly to pdc would be unlikely due to all platform specific USB code that would have to be added to pdc. However, I could look at adding a flag to the Sim so if you passed the game path using the CLI with this flag it would upload it to the device.

4 Likes

Oh yeah that works! Definitely doesnt need to be in the pdc command. Thanks!

Hi @willco
Was that flag implemented? It would be really useful to have a quick way to test things on the device without moving out of the IDE :smiley:

Thanks!

I totally forgot about this, I'd still like to do it. I've targeted it to the next major release, hopefully I can get to it.

1 Like

Wait are people not using pdutil? When I make a device build I auto install and run it on device.

pdutil.exe install ../Game.pdx & timeout.exe /t 1 & pdutil.exe run Games/Game.pdx

edit: I mean also being able to auto deploy from sim would be cool too.

2 Likes

Whaaaa?... I've been developing for playdate for a while now and it is my first time learning about pdutil. My bad for only referring to the "Inside Playdate" docs, and nothing else. :smiley:

pdutil doesn't support the install command on Linux or Mac. However, adding it shouldn't be too hard...hum. Ya'll are making more work for me, not less. :wink:

1 Like

Having no work to do is soul destroying. We're looking out for you Will.

In the meantime, this is the script I use to install and run a pdx to device from Mac.

It uses
Pdutil to reboot device to data disk mode
RSync to copy the pdx (efficiently; only changed files)
Diskutil to stop data disk mode and reboot the device to launcher as a side effect
Pdutil to start the game

If you want to use this, you'll have to remove some unrelated lines and adjust it a bit to your file structure

1 Like