Replying to myself, I'm my case the error was because I code signed the executable, duh.
Post
Replies
Boosts
Views
Activity
I bumped into this while adding a static Perl into my App. As an FYI it was a sandbox thing "Process is not in an inherited sandbox": Perl worked fine when called from the App but failed when I poked inside from Terminal and tried to run it while debugging. Spent a good amount of time tracking this down while at the same time making it Fat for Apple Silicon.
(Aside: any update on when Perl's (et.al.) removal will be official? )
Process: staticPerl5.30.0 [95059]
Path: /Users/USER/Library/Developer/Xcode/DerivedData/Edit_Edge_Data-dpmjxqquuuqzhffrqhwzehmoowtv/Build/Products/Debug/Edit Edge Data.app/Contents/Resources/perlembed/bin/staticPerl5.30.0
Identifier: staticPerl5.30.0
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [13513]
Responsible: Terminal [68576]
User ID: 502
Date/Time: 2021-05-03 13:42:50.546 -0500
OS Version: macOS 11.3 (20E232)
Report Version: 12
Bridge OS Version: 5.3 (18P4556)
Anonymous UUID: 88313202-BD67-335F-59FE-96C5DE7681E6
Time Awake Since Boot: 410000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [95059]
Application Specific Information:
dyld: launch, running initializers
/usr/lib/libSystem.B.dylib
Process is not in an inherited sandbox.
Application Specific Signatures:
Process is not in an inherited sandbox.
I usually log NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) and then use Terminal to cd in that general area 🙂
> I haven't submitted this yet, so can't vouch for it passing app review, but here is my solution:Have you submitted the App and did it pass review? Now you have me worried that I've wasted a lot of time on this. Which would be a shame, the App's window behavior is super cool and very Mac-like.
This is the technique I have settled on. Once you have this macOS bundle loaded you have complete access to, among everything else, NSWindow. Since you can make yourself an NSWindowDelegate you can make methods calls from UIKit to AppKit methods and handle delegate responses. You can respond to Green Button clicks, and even make that button a Zoom button rather than the default Fullscreen button.And that is what I have done: turned the button into Zoom so I can toggle between two window sizes.[self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary | NSWindowCollectionBehaviorFullScreenNone];Now these window delegate methods come into action:- (NSSize)windowWillResize:(NSWindow *) window toSize:(NSSize)newSize;
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame;I also noticed that I could not make a window very small using the scene’s sizeRestriction:self.windowScene.sizeRestrictions.minimumSize = kMacCatMinimumWindowSize;But after setting the window’s minSize you can, mine is now 60x60:self.window.minSize = kMacCatMinimumWindowSize;BTW this is how I instantiate the glue class (ignore line #3, cannot seem to delete that line in the web page editor): NSBundle *catalystBundle = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"AppKitGlue.bundle"]];
BOOL catalystBundleIsLoaded = [catalystBundle load];
macOS = [macOS stringByAppendingFormat:@"/%d", catalystBundleIsLoaded];
self.appKitGlue = [[[catalystBundle principalClass] alloc] init];