Utilities for checking plist metadata, extracting entitlements, patching Mach-O platform data, and re-signing app bundles for local testing on macOS.
Use this only with apps you are authorized to test.
- macOS with Xcode command line tools (
xcrun,codesign,otool) - Python 3
sudoaccess (scripts can move output to/Applications)
Use test_generalized.sh when you want parameterized input instead of hardcoded app paths.
Required args:
--method(-1or-2)--app(path to.app)--macho(path to main Mach-O inside app)--info-plist(path toInfo.plist)
Optional args:
--ipa-zip(extract app from zip first)--entitlements(custom entitlements output file)--skip-install(skip moving to/Applicationsand opening)
Examples:
./test_generalized.sh \
--method -1 \
--app ./NotebookLM_prod.app \
--macho ./NotebookLM_prod.app/NotebookLM_prod \
--info-plist ./NotebookLM_prod.app/Info.plist./test_generalized.sh \
--method -2 \
--ipa-zip /path/to/notebooklm.zip \
--app ./NotebookLM_prod.app \
--macho ./NotebookLM_prod.app/NotebookLM_prod \
--info-plist ./NotebookLM_prod.app/Info.plistWhat this flow does:
- Optionally unzips IPA and extracts the target
.app - Normalizes plist/signature-related keys (
checkplist_iOSig.py) - Patches Mach-O
LC_BUILD_VERSIONfields - Re-signs nested frameworks/extensions (inside-out)
- Re-signs final app bundle
- Optionally moves app to
/Applications - Optionally clears xattrs and opens the app
test_from_here.sh is kept as-is for developer-specific testing and automation.
Run:
./test_from_here.sh -1or
./test_from_here.sh -2Mode details:
-1: extract entitlements from the main Mach-O usingentitlement_ipa.py-2: generateentitlements.plistfrom the script template
python checkplist_iOSig.py some_app.app/Info.plistpython entitlement_ipa.py some_app.app/some_machopython patchBinaryPlatformWithMatchingInfoPlist.py some_app.apppython signAppWithentitlements.py some_app.app entitlements.plist "Signing Name"codesign --verify --deep --strict --verbose=6 Some.appcodesign -d --entitlements - Some.appspctl -a -vv Some.appzsh: killedon direct binary launch: nested code objects are usually not signed correctly, or launch policy blocked execution.open ... Launch failed/spawn failed: retry after signing, then approve in macOS Privacy & Security if prompted.codesign --verifypasses but app still blocked: that only validates signature consistency; macOS policy/Gatekeeper may still reject launch.
If you make this repo public, document ownership/authorization expectations clearly and avoid shipping private app assets or credentials.
This project is available under the MIT License.