Option to Upload Game to Device with cleanup

My understanding is that when the Simulator upload game to the device, it will upload only the files that are newer.

It will also keep the files that were doesn't exist anymore in the newer pdx. As a result you might have more files in the pdx on the Playdate compared to the one running in the simulator.

In most cases it shouldn't be a problem but if the game is using playdate.file.listFiles() or playdate.file.exist() you might end up in unexpected behavior compared to the simulator since it might read files that you thought you deleted from your project.

Ideally I think the files that are on playdate pdx but not in the uploaded pdx should be removed. If not possible having an option to cleanup the pdx on the playdate would be useful since it would not require us to boot in Data disk and manually clean up.

2 Likes

Agreed.

In fact, I filed a bug about this a long time ago.

I also suggested rsync could be used to sync the contents if there were concerns that a full delete and reupload would be too slow.

The Mac sim does remove any orphaned files when copying the game. While the Windows/Linux sim completely removes the game and replaces it.

I believe that was only added with 1.3.x on Mac?

Looks like it was 1.2 (https://devforum.play.date/t/playdate-sdk-1-2/1721):

* Upload Game to Device now deletes items on the disk that are no longer in the game pdx

1 Like