fix(ios): re-signed Xcode debug builds crash at launch (unsigned .debug.dylib) - #433
Conversation
`apps install --force-resign` signed Frameworks/ and PlugIns/ but not dylibs in a bundle's root. Xcode debug builds keep the app's code there (<Name>.debug.dylib next to a stub executable, plus __preview.dylib), and signing the bundle does not sign them, so every re-signed debug build died at launch: Library not loaded: @rpath/Runner.debug.dylib ... mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. Sign them before the bundle that contains them, for the app and for each app extension.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: mobile-next/mobilecli/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 WalkthroughWalkthrough
ChangesLoose dylib signing
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant ResignIPA
participant looseDylibs
participant signLooseDylibs
ResignIPA->>looseDylibs: discover root-level .dylib files
looseDylibs-->>ResignIPA: return dylib paths
ResignIPA->>signLooseDylibs: sign dylibs without entitlements
signLooseDylibs-->>ResignIPA: return result
ResignIPA->>ResignIPA: sign the app or extension bundle
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Summary
mobilecli apps install --force-resignbroke every Xcode debug build. The app installed fine and then died at launch, straight back to the home screen:Since Xcode 15 (
ENABLE_DEBUG_DYLIB), debug builds keep the app's code in<Name>.debug.dylibnext to a stub executable, plus__preview.dylib, in the bundle root.ResignIPAsignedFrameworks/*.framework,Frameworks/*.dylibandPlugIns/*.appex|*.xctest, then the app bundle — and signing a bundle does not sign loose dylibs inside it.signLooseDylibsnow signs the.dylibfiles directly in a bundle's root before that bundle is signed (code is signed inside-out). It runs for the app and for each app extension, which get their own<Name>.debug.dylib.Release and profile builds have no loose dylibs, so nothing changes for them.
Test plan
looseDylibs: finds only the root dylibs of a debug app layout (notFrameworks/, not an extension's), works on an.appex, empty for a release layoutgo vet ./... && go test ./... -raceflutter build ios --debug --no-codesign,codesign -dv Runner.debug.dylib→code object is not signed at all. Before: launch → SpringBoard + the crash report above. After:apps install --force-resign→ app stays in the foreground (FlutterViewController), 0 new crash reportsSummary by CodeRabbit
Bug Fixes
Tests