blake502 / balatro-mobile-maker

Create a mobile Balatro app from your Steam version of Balatro
270 stars 21 forks source link

Save data not transferring onto IOS #64

Closed CoffeeDoster closed 1 week ago

CoffeeDoster commented 2 weeks ago

Not sure if I'm doing something wrong. The game itself works amazing (awesome work btw) but I was wondering if it was possible to transfer save data to IOS. Nothing has been mentioned in issues or the description, so I wasn't sure if it was an android exclusive thing.

kylefmohr commented 1 week ago

It isn't currently supported via the script, and I'm not sure of a way to add this as a feature, however I can tell you that it is possible to manually transfer your save. The method of enabling this, however, will vary based on what tool you're using to sign the IPA file.

For example, if you're using Sideloadly, you'll simply need to click Advanced Options and check the box for Enable File Sharing. If instead you're using ESign to sign the app on-device, you'll need to click More Settings then Supports Document Browser. SignTools also has an option under Advanced called Force enable file sharing.

Once you've installed the app with file sharing enabled, you'll be able to see a Balatro folder in the Files app on your iDevice. It should look exactly like the Balatro save directory on your computer, just move those save files over from your computer and restart the app. I can confirm this works with the most recent Balatro update.

I wish there were a way to automate this, but I don't know of any way to do so.

clwang714 commented 1 week ago

Syncing the save files between iOS and PC can be automated, although it will take some jank to setup:

PC Setup:

  1. Setup iCloud Drive for Desktop
  2. Move your Balatro save folder to iCloud Drive
  3. Create a symlink on your PC from your old save location to your new iCloud Drive save location

Your PC can now read and write save data directly to iCloud Drive.


iOS Setup:

  1. Sideload the Balatro IPA
  2. Open the app once so that it can create a Balatro save folder in your Files app (locally on your device, not in iCloud Drive)
    • if you are jailbroken, you can use Filza to create a symlink from this local folder to your new save folder in iCloud and skip the rest of the steps

For non-JB, we will have to create some Shortcuts to automatically sync this data to iCloud:

Pushing to iCloud:

  1. Create a new Shortcut using Get contents of folder (select your local save folder) and Save File (save "Contents of Folder" to your iCloud save folder). This will copy your local save from phone to iCloud, so your PC will have the updated save data
    • Recursive - no, Ask Where To Save - no, Overwrite If File Exists - yes
  2. Create a Shortcuts automation to run this shortcut when Balatro app is closed

Fetching from iCloud

  1. Create the same Shortcut as above but reverse the two folders
  2. Add another step to the Shortcut to launch the Balatro app. Then add the shortcut to the home screen (you can change the icon). Use this shortcut to launch the game, instead of the actual app
    • (we can't use Shortcuts automations like above, because running the shortcut after Balatro is already launching is not fast enough. the game finishes launching before data is synced)

Note that the game only updates the save file intermittently, which can lead to problems with save data syncing. I always make sure to exit to main menu, which seems to force a save. Also, if you are having issues, try to wait at least 15-20 seconds after closing the game before launching it on a different device to ensure that the iCloud sync completes. I always kill the app as well to be super safe

jawshoeadan commented 6 days ago

Using pymobiledevice3 would be an easier way of doing the same thing, where you can use AFC to push the saves folder to the device, but you’d have to use the script to build the ipa, then sideload it through whichever method, then come back to the script to copy the saves over