Repository navigation
nxnative for Mac: install an iPhone build on a paired device - #28
Conversation
01cdc25 to
fc17f71
Compare
…ssue #29) v0lumehi read the sync script while working on #27/#28 and found a real structural gap: a fix merged here into a vendored file that is neither OURS nor PATCHED is silently reverted the next time upstream touches that file. The concrete instance was PR #26 itself — hle_time.c and its test carry the adjustable-clock entry, neither was protected, and seedds has no such function. Both parts of the suggestion are taken: - hle_time.c and t_time.c join OURS (with a comment saying why, and that they leave if upstream takes the PR). Found by the issue, verified by the code: neither file was in either list. - A new pr-scope workflow fails a PR that edits a vendored file outside OURS/PATCHED and outside the fork-only paths (frontend/, frontend-qt/, .github/workflows/), with the at-risk list and the two ways out. It reads OURS and PATCHED from sync_upstream.py itself, so the check cannot drift from the lists it enforces.
|
Read, and the shape is right — I want this in once #27's landing is settled on your side. Two things worth saying, one question, and a request that will make review fast. On the design: routing through
Why it cannot merge today: it builds on #27, which landed an hour ago — GitHub shows My question: the game files live inside the app on this route, so no RomFS archive is packed. That is the simple mental model, and for a first version it is right. But it means an iPad mini holds the whole game twice if the user also keeps the archive for a sideloaded copy, and the archive was built to make 16 GB titles installable at all. Is the plan that the developer route is for "Mac and a cable" users while sideloading + archive stays the mainstream route, or do you see the archive following the developer route too (the app reads it from its own Documents the same way it does today)? I ask because it decides whether the launcher's card should offer the choice rather than assume it. What I verified already: the test additions parse Rebase and it gets a full review the same hour; the tests here all run. |
fc17f71 to
c41ba0d
Compare
|
@LNPANDY, thanks. Both are done: Rebased onto current main ( On the archive question: you were right that the first version opened a second route, with the game files inside the app. I'd rather have one standard, so the developer route now uses the archive like sideloading (commit
This way:
The card needs no choice: the cable route is the sideload route with the signing and copying done for you. The fixture test checks the order (archive → sign → install → copy) and every argument, including Still open: a run on a real device. That is next, done by hand. |
With Xcode, a development certificate and a paired iPhone or iPad, the launcher can send an iPhone build straight to the device: choose it under Install on, with the signing team. The script prepares the game's Xcode project (--prepare-xcode --team-id) instead of an IPA, xcodebuild -allowProvisioningUpdates signs it for the device (Xcode makes the profile), and devicectl installs it; the game files are inside the app, so no RomFS copy follows. The game then shows in the library, and its button opens it on the device. Without a device or a team the build stays an unsigned IPA. Devices come from devicectl list devices (physical, paired; reachable first), teams from security find-identity, each team read from its certificate's organizational unit. xcodebuild and devicectl run as stages of the build in its process group, so Stop ends them too.
…ading The first version put the game files inside the app (the Xcode project copies the RomFS). That made a second route next to the standard one, and the archive is what makes large games installable at all. The install now takes the standard route: - The NSP script still prepares the Xcode project; then the RomFS archive is packed (or reused) exactly as for an IPA, in <out>/games/<title ID>/romfs. - xcodebuild signs the app for the device with DM_COPY_ROMFS=NO, so the game files stay out of it. - devicectl installs the app, then copies the archive into the app's Documents/games/<title ID>/romfs, where main.m looks first. devicectl skips files that did not change, so a reinstall sends the code and shaders, not the game again. The fixture test checks the order (archive, sign, install, copy), the DM_COPY_ROMFS=NO build, the copy's arguments and the archive path the library records. The card's note, the README and the Qt strings say the same.
… game data is one image Main now packs games/<title ID>/romfs.img with the DLC in aoc/ beside it, in place of the ROMFSARC shards. The device route copies that folder into the app's Documents/games/<title ID>/, the shape main.m reads, so the DLC goes along too. The fixture's packer stand-in is romfs_image.py.
e31d519 to
c438bb6
Compare
The update machinery was already here — checkAppUpdate finds the newest release, performAppUpdate downloads it, swaps the bundle and relaunches — but the only signal was a status line naming a tag. A user whose app worked had no way to judge whether the new version mattered, so "Update to v0.4.8" was a leap of faith, and most people took the leap only when something broke. Now a found update opens a sheet: the version they have, the one on offer, the release notes for their interface language, Open the release page, Later, and Update now. It opens from the launch check and from Check for updates, so an old install learns what changed without visiting GitHub. The notes are the release body, which this project writes in both languages (docs/RELEASE-NOTES-GUIDE.md). UpdateSheet.lines splits them by the `**中文**` / `**English**` markers rather than by looking for Han characters — the first version did the latter and handed an English reader the Chinese paragraph, because that line contains both. A body with no markers is shown whole instead of being split in half. Six tests cover the split, including the two cases that failed on the first attempt (a monolingual body, and inline **bold** inside a marked paragraph). Checked against the real v0.4.7 body: 19 lines each way, aligned. appVersion 0.4.7 → 0.4.8: today's merges (#28, #48, #54–#57, #59, #60 and the #52/#53 fixes) were shipping under a version number that also names the 0.4.7 release, so a bug report could not say which one it came from.
…alled on (LNPANDY#66) A save lived in ~/Library/Application Support/nxnative/<title ID>/save on the Mac (dm/mac/launcher.c) and in Documents/games/<title ID>/save in the iPhone app's container (dm/ios/Sources/main.m, the per-game folder a launcher install uses), and the two never met. Manage > Saves... (a controller's Y) opens a sheet with both saves' newest file dates, the newer one marked, and a copy either way over LNPANDY#28's route: devicectl with the installed app's data container, on the device the game was installed on. The save being replaced is backed up first, beside the Mac save in save-backups/<date> mac or <date> device. A copy from the device lands beside the Mac save before the old one moves into the backup, so a failed copy changes nothing; a copy to the device first fetches the device's save to the Mac and stops if that fails. save_device (hle_fs.c, a game that mounts device save data beside its account save) goes along. The copy is refused while a build of the game runs on the Mac, and the question says to close the game on the device. The question is asked in the sheet, so a controller can answer it. All devicectl calls go through one replaceable function (DeviceControl). The tests serve a temporary folder as the device's container through a stand-in and never run devicectl: reading both sides, both copies with their backups, a failed or unreachable device replacing nothing, the copy-to destination being the save folder and never the game folder that holds romfs.img (a mutation of it fails three tests), a copy nested in its destination, the listing's dates, the newer side, and finding a running build by its title ID. swift build -c release is clean, swift test passes (56, 3 skipped), and the visual QA renders the sheet and its question with the controller's focus on it. Not checked on a real device: devicectl's JSON (the dates are read from CoreDevice's modificationDate key wherever it nests) and whether copy from puts the folder at or inside --destination (both are handled).
…alled on (LNPANDY#66) A save lived in ~/Library/Application Support/nxnative/<title ID>/save on the Mac (dm/mac/launcher.c) and in Documents/games/<title ID>/save in the iPhone app's container (dm/ios/Sources/main.m, the per-game folder a launcher install uses), and the two never met. Manage > Saves... (a controller's Y) opens a sheet with both saves' newest file dates, the newer one marked, and a copy either way over LNPANDY#28's route: devicectl with the installed app's data container, on the device the game was installed on. The save being replaced is backed up first, beside the Mac save in save-backups/<date> mac or <date> device. A copy from the device lands beside the Mac save before the old one moves into the backup, so a failed copy changes nothing; a copy to the device first fetches the device's save to the Mac and stops if that fails. save_device (hle_fs.c, a game that mounts device save data beside its account save) goes along. The copy is refused while a build of the game runs on the Mac, and the question says to close the game on the device. The question is asked in the sheet, so a controller can answer it. All devicectl calls go through one replaceable function (DeviceControl). The tests serve a temporary folder as the device's container through a stand-in and never run devicectl: reading both sides, both copies with their backups, a failed or unreachable device replacing nothing, the copy-to destination being the save folder and never the game folder that holds romfs.img (a mutation of it fails three tests), a copy nested in its destination, the listing's dates, the newer side, and finding a running build by its title ID. swift build -c release is clean, swift test passes (56, 3 skipped), and the visual QA renders the sheet and its question with the controller's focus on it. Not checked on a real device: devicectl's JSON (the dates are read from CoreDevice's modificationDate key wherever it nests) and whether copy from puts the folder at or inside --destination (both are handled).
…alled on (LNPANDY#66) A save lived in ~/Library/Application Support/nxnative/<title ID>/save on the Mac (dm/mac/launcher.c) and in Documents/games/<title ID>/save in the iPhone app's container (dm/ios/Sources/main.m, the per-game folder a launcher install uses), and the two never met. Manage > Saves... (a controller's Y) opens a sheet with both saves' newest file dates, the newer one marked, and a copy either way over LNPANDY#28's route: devicectl with the installed app's data container, on the device the game was installed on. The save being replaced is backed up first, beside the Mac save in save-backups/<date> mac or <date> device. A copy from the device lands beside the Mac save before the old one moves into the backup, so a failed copy changes nothing; a copy to the device first fetches the device's save to the Mac and stops if that fails. save_device (hle_fs.c, a game that mounts device save data beside its account save) goes along. The copy is refused while a build of the game runs on the Mac, and the question says to close the game on the device. The question is asked in the sheet, so a controller can answer it. All devicectl calls go through one replaceable function (DeviceControl). The tests serve a temporary folder as the device's container through a stand-in and never run devicectl: reading both sides, both copies with their backups, a failed or unreachable device replacing nothing, the copy-to destination being the save folder and never the game folder that holds romfs.img (a mutation of it fails three tests), a copy nested in its destination, the listing's dates, the newer side, and finding a running build by its title ID. swift build -c release is clean, swift test passes (56, 3 skipped), and the visual QA renders the sheet and its question with the controller's focus on it. Not checked on a real device: devicectl's JSON (the dates are read from CoreDevice's modificationDate key wherever it nests) and whether copy from puts the folder at or inside --destination (both are handled).
Install an iPhone build on a paired device
Rebased on current main (#27 is merged). Rebased again onto 4e37642 (game data as one
romfs.img). There are three commits: the install itself, the switch to the sideloading route for the game data, and the move toromfs.imgwithaoc/.Today an iPhone build ends with an unsigned IPA and three manual steps (sideload it, copy the RomFS shards into the app's Documents, start it). For people who have Xcode and a development certificate, the launcher can now do this itself:
Install on lists the iPhones and iPads paired with this Mac (
xcrun devicectl list devices: physical, paired, reachable ones first); Signing team lists the development identities in the keychain (security find-identity), each with its team read from the certificate's organizational unit (not the code in the certificate's name, which is the personal ID).With both chosen, the script prepares the game's Xcode project (
--prepare-xcode --keep-extracted --team-id, the developer route it already has) instead of packing an IPA. The launcher then signs it for the device,xcodebuild … -destination id=<UDID> -allowProvisioningUpdates DEVELOPMENT_TEAM=<team> build(Xcode creates the provisioning profile), and installs it,xcrun devicectl device install app. Both show as steps of the build, with Stop ending them as it ends the script.The game files take the standard route, as for sideloading:
<out>/games/<title ID>/romfs.img, with the DLC inaoc/beside it;DM_COPY_ROMFS=NO);xcrun devicectl device copy toputs that folder into the app'sDocuments/games/<title ID>/, wheremain.mlooks first.devicectl skips files that did not change, so a reinstall sends the code and shaders, not the game again.
The game then appears in the library, and its button opens it on the device (
devicectl device process launch).Don't install, export the IPA (the default) keeps the unsigned IPA exactly as before; without Xcode, a certificate or a paired device nothing changes.
The first install needs Developer Mode on the device and trusting the developer (Settings → General → VPN & Device Management); with a free Apple ID the profile expires after seven days. Both are said under the card.
frontend/README.mdhas a section on it.Tests
swift test --package-path frontend(20 tests): parsingdevicectl's device list andsecurity's identities and certificate subjects, and a whole build with stand-ins for the script,xcodebuildanddevicectlthat checks:-allowProvisioningUpdates,DM_COPY_ROMFS=NO, the install path, the copy of the game's folder;Not tested on a device yet: signing and installing for real is the next step, done by hand.
Screenshot
The Install card for an iPhone build, as the visual QA test renders it. The device and the team are the test's stand-ins, not real ones.