Post

Replies

Boosts

Views

Activity

SMAppService.daemon initial pkg install
What I did. Started with the example at https://developer.apple.com/documentation/servicemanagement/updating-your-app-package-installer-to-use-the-new-service-management-api Changed it to configure a system daemon instead let service = SMAppService.daemon(plistName: "com.xpc.example.daemon.plist") Disabled automatic register in the package postinstall script (or else pkg install fails) Built/Installed the package, it just places files in the disk Validated install files Ran the test|register commands by hand sudo ../SMAppServiceSampleCode.app/Contents/MacOS/SMAppServiceSampleCode" register Dealt with System Settings user interaction to do this Validated that com.xpc.example.daemon is installed and ready to work sudo launchctl list | grep example sudo launchctl print system/com.xpc.example.daemon Got it to successfully do some work, YAY sudo ../SMAppServiceSampleCode.app/Contents/MacOS/SMAppServiceSampleCode" test Expectations My users would obviously download and install this pkg, so to make it easy for them. I would expect that I could call SMAppService.daemon(plistName: "...") .register() during the package postinstall installation step and the system daemon would be configured. Observations After getting all my teeth pulled why can't I just do that? Why so many hurdles for the dev and the end user, asking them to code sign this and that, notarize this and that, click here and there, accepting this and that? I understand the job of a developer but for the end user this should be relatively easy. Questions Do I need to start a DTS ticket to get this simple flow to work? It could be I'm missing step 42 in my endeavor :-)
0
0
367
Aug ’24
getattrlistbulk inode
Why is that getattrlistbulk returns a 64 bit inode for /Applications, /Library, /Users, /Volumes BUT finder, terminal, stat are retuning a shorter version stat /Applications 16777253 78133671 drwxrwxr-x 66 root admin 0 2112 "Feb 11 14:39:30 2022" "Feb 11 14:39:29 2022" "Feb 11 14:39:29 2022" "Jan  1 03:00:00 2020" 4096 0 0x100000 /Applications ls -ail / | grep Applications            78133671 drwxrwxr-x  66 root  admin  2112 Feb 13 01:28 Applications/ getattrlistbulk returns 1152921500311879699 I was using getattrlistbulk code example from https://developer.apple.com/forums/thread/656787/
8
0
1.4k
Feb ’22
EXC_BAD_INSTRUCTION SIGILL
I have an interesting crash case that basically just points the finger into one method. NodeFactory.appendChildren() This method is parsing results from getattrlistbulk() and uses some code excerpts from the following developer discussion Getting inode number from URL The entire app has been using swift for the least couple of years and slowly evolving to use less and less C/Objective-C 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 [3386] ... Thread 8 Crashed:: Dispatch queue: NSOperationQueue 0x7f83aa104920 (QOS: USER_INTERACTIVE) 0 com.bla.myapp 0x000000010f5bd8f0 NodeFactory.appendChildren(_:_:_:_:_:) + 4544 1 com.bla.myapp 0x000000010f5bf15b NodeFactory.fetchChildren(_:) + 1163 2 com.bla.myapp 0x000000010f5bf9ca NodeFactory.fetch(nodeEntry:) + 90 3 com.bla.myapp 0x000000010f5c041f partial apply for closure #3 in NodeFactory.fetch(nodeEntry:) + 127 4 com.bla.myapp 0x000000010f5505fe thunk for @escaping @callee_guaranteed () -> () + 14 5 com.apple.Foundation 0x00007fff33b72ac5 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7 6 com.apple.Foundation 0x00007fff33b729e6 -[NSBlockOperation main] + 80 7 com.apple.Foundation 0x00007fff33b72981 __NSOPERATION_IS_INVOKING_MAIN__ + 17 8 com.apple.Foundation 0x00007fff33b71bb3 -[NSOperation start] + 722 A more seasoned programmer might see a bug in the body of the appendChildren(). However I'm interested in tips/flags to Xcode Settings so that apple's crash reporter is able to collect and provide more clues in the crash report. The current Xcode has: Debug Information Format = DWARF Strip Debug Symbols = NO Optimization Level = Fastest Thank you.
7
0
4k
Nov ’21