Repository navigation
Find the game's save on the device itself and choose an iPhone or iPad - #260
Merged
Merged
Conversation
v0lumehi
force-pushed
the
v0lumehi/saves-discovery
branch
from
October 30, 2026 16:26
7e4d660 to
fd3571b
Compare
Manage > Saves no longer needs the launcher's install record or the signed app it cached: the game is found on the device from `devicectl device info apps` (the launcher's bundle ID, any bundle ID holding the title ID, then the display name), so a game installed from the exported IPA with another signing tool works. Both save layouts are read, Documents/save and Documents/games/<title ID>/save, and a copy goes to the one in use. With several devices the sheet shows a selector and names the device it asks. A device that is not connected is not asked at all. Every devicectl command has a deadline, a query that outlives its own gets a clear message, Refresh is off while one runs, and an answer that arrives after its query was given up or replaced is dropped. Closes #250 Co-authored-by: Tiomehsh <[email protected]>
v0lumehi
force-pushed
the
v0lumehi/saves-discovery
branch
from
October 30, 2026 17:02
fd3571b to
227534c
Compare
…ch folder is used A Mac game in a library folder (.nx2apple-library beside the app) keeps its save in save/<title ID> there. The Saves window now uses the host's rule instead of the games/ folder, prefers that folder over the default location when both exist, and shows the folder under This Mac. Co-authored-by: Tiomehsh <[email protected]>
v0lumehi
force-pushed
the
v0lumehi/saves-discovery
branch
from
October 30, 2026 17:02
227534c to
b60ccdf
Compare
3 tasks done
On a real device the flag deletes the destination's siblings too, not only its contents. A save push to Documents/games/<id>/save removed the game's romfs.img, and a cheats push removed what sits beside Documents/games/<id>/cheats. The copies now merge into the destination and delete nothing. A file the Mac no longer has can stay in the device's folder, which is far safer than wiping game data (devicectl has no command to delete a single file). The stand-in devicectl in the tests now wipes the parent's entries when the flag is passed, and the tests assert the flag is never passed and that game data stays. Found and reproduced on real devices by Tiomehsh (#250). Co-authored-by: Tiomehsh <[email protected]>
Collaborator
Author
|
Pushed the same fix as #266 onto this branch (cherry-picked, so it merges cleanly in either order): the launcher never passes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Closes #250. Thanks @Tiomehsh for the report and for the reference patch.
Two problems in Manage > Saves:
The change, all in
frontend/:devicectl device info apps(with--include-default-apps, as an app signed by another tool is not a developer app) is matched in this order: the bundle ID this launcher recorded,org.nxnative.<title ID>, any bundle ID containing the title ID, then the display name against the game's name. The app's bundle ID is the data container. No local Xcode project or cached signed app is needed.Documents/saveandDocuments/games/<title ID>/saveare both read. The layout that holds a save is the one in use. With saves in both, or in neither, the per-game folder wins when it holdsromfs.imgorromfs(what the runtime does), else Documents. A copy to the device goes to that layout. Confirmation and backups are unchanged.--timeoutplus a process deadline (10 s for a query, 180 s for a copy). A newSavesModelruns one query at a time, ends it with a "did not answer in time" message after 30 s, disables Refresh while it runs, lets a device choice replace a running query, and drops an answer that arrives after its query was given up or replaced. A timeout in the middle of a read is an error, never "No save yet".From @Tiomehsh's patch: the process deadline around devicectl (terminate, then SIGKILL), the
Refreshdisabled while reading, reading both the Documents and the per-game layout and the romfs rule for the active one, and the newer CoreDevice listing shape inparseListing(metadata.lastModDate,resources.isDirectory, without counting a directory's metadata twice). Their commit is credited with aCo-authored-bytrailer.What differs: their patch guesses the bundle ID (
org.nxnative.<title ID>) and tries each paired device in turn. Here the app is looked up in the device's app list, so any bundle ID works, and the user picks the device instead of the launcher hopping between them. The timeouts and stale-result handling live in a model with a faked devicectl, so they are tested.Mac save path follows the library folder. The Mac side used to look for a
games/folder beside the app, which is not what the host does. It now followsdm/mac/launcher.c: with the.nx2apple-librarymarker beside the app the save issave/<title ID>there, otherwise~/Library/Application Support/nxnative/<title ID>/save. When both exist the one beside the app wins (the game copies the other only while it is empty), and a ~/Library save is shown only until the game has copied it across. Confirmation and backups are unchanged. The Mac row says which folder is used, also when there is no save yet. This is the gap @Tiomehsh found on the real devices, so no separate issue is needed.Checked
cd frontend && swift test(490 tests, 0 failures),python3 scripts/patches.py check(ok). NewSaveDiscoveryTestswith a faked devicectl cover: discovery of a non-launcher install, bundle matching, two devices and the selector state, a hanging query hitting the timeout and its late answer dropped, a real hanging process stopped by the deadline, Refresh while a query runs, a device that is not connected, both save layouts with copies in each direction, and the Mac save location with temporary folders for a library folder, the default location and both at once (migration).NX_LAUNCHER_CAPTURE_DIR=<dir> swift test.Documents/save, the device picker, Refresh disabled while reading, and a byte-identical round trip. The Mac library-folder path was not part of that test.--timeoutwording, and the complete UI transfer with the library-folder layout (asked of @Tiomehsh).Screenshots
None yet, see above.
Scope
dm/,scripts/,docs/,ref/,AGENTS.md) is edited directly: a change there is a patch inpatches/(scripts/patches.py export, andpatches.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#...(not applicable, launcher only)This is a feature, so it waits 48 hours before merging.