Skip to content

Install: reinstall the signed app, or save it as an IPA, without building again - #149

Merged
LNPANDY merged 1 commit into
mainfrom
task-145-reinstall-saveipa
Oct 28, 2026
Merged

LNPANDY merged 1 commit into
mainfrom
task-145-reinstall-saveipa

Conversation

@LNPANDY

@LNPANDY LNPANDY commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Part of #145 (the first half). A device build ends in xcrun devicectl device install app, so it never writes an .ipa: deleting the app on the phone meant a full rebuild (extraction, shaders, signing), and the signed build could not be handed to another Mac or a sideloader.

The signed .app already sits in <game>_build/xcode-derived-data/Build/Products/Release-iphoneos/. The install card now uses it.

What changes

  • Reinstall — xcrun devicectl device install app --device <UDID> <cached .app>, as it is: no unpack, no signing, no packing, no game-file copy. The bundle ID does not change, so the device keeps the app's Documents (game data and saves).
  • Save IPA… — NSSavePanel (default name from the app's display name, separators replaced), then the app as Payload/<name>.app packed with ditto -c -k --norsrc --keepParent. That is an ordinary IPA a sideloader or another Mac installs while the signature lasts; the game data is not in it (it stays in Documents/romfs.img), and --norsrc keeps __MACOSX out.
  • Messages — a missing cached app, a failed reinstall (devicectl's own error line, unchanged) and a failed pack each say what happened and what to do next; all new strings are en + zh.
  • A failed reinstall is a note on the installed app, not a failed build: the app is still on the device.

The 7-day expiry and the re-sign button are the second half of #145, a separate PR: this one never re-signs.

Verified

  • swift test --package-path frontend → 183 tests, 6 skipped, 0 failures (L10n.selfCheck() included, so both languages are non-empty).
  • New cases: reinstall issues the plain devicectl install of the cached app and runs no second xcodebuild and no second romfs pack; the saved archive lists Payload/DmIOS.app/Info.plist and no __MACOSX; both actions name the missing app; the IPA name drops / and :.

Not verified

  • A real device/reinstall and an actual sideload of the saved IPA — the owner's to do. The sandbox-free behaviour of devicectl is exercised through the existing fake-xcrun fixture only.

A device build ends in `devicectl device install app`, so it never writes an
.ipa: deleting the app on the phone meant a full rebuild (extraction, shaders,
signing) to get it back, and nothing could hand the signed build to another
Mac or a sideloader.

The signed .app already sits in xcode-derived-data. The install card now has:

- Reinstall: `devicectl device install app` of that app as it is — no unpack,
  no signing, no packing. The bundle ID does not change, so the device keeps
  the app's Documents (game data and saves).
- Save IPA…: NSSavePanel, then the app as Payload/<name>.app, an ordinary IPA
  a sideloader or another Mac installs while the signature lasts. The game
  data is not in it (it stays in Documents/romfs.img), and --norsrc keeps
  __MACOSX out.

A missing cached app, an expired signature (devicectl's own error line) and a
failed pack each say what happened and what to do, in both languages.

Verified: swift test --package-path frontend -> 183 tests, 6 skipped, 0
failures (5 new: the reinstall command and that it does not build or pack
again, the Payload zip listing, the two missing-app paths, the IPA name).
Not verified: a real device (the owner's).
@LNPANDY
LNPANDY force-pushed the task-145-reinstall-saveipa branch from d99fff2 to 9fe5038 Compare October 28, 2026 17:30
@LNPANDY
LNPANDY merged commit 0c479df into main Oct 28, 2026
7 checks passed
@LNPANDY
LNPANDY deleted the task-145-reinstall-saveipa branch October 28, 2026 17:44
LNPANDY added a commit that referenced this pull request Oct 28, 2026
Revert #149: the reinstall/save-IPA work is still being iterated
v0lumehi pushed a commit to v0lumehi/NX2Apple that referenced this pull request Oct 28, 2026
…l-saveipa"

This reverts commit 0c479df, reversing
changes made to 8536779.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant