XPC is a a low-level (libSystem) interprocess communication mechanism that is based on serialized property lists.

XPC Documentation

Pinned Posts

Posts under XPC tag

45 Posts
Sort by:
Post not yet marked as solved
2 Replies
1.1k Views
Development Environment: Xcode Version: 14.3.1 macOS Ventura Version: 13.6.2 Architecture: Intel I am developing a macOS app with an accompanying XPC service and am encountering an issue where the XPC connection is immediately invalidated upon trying to establish it. The error message received is: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.appname.macos.app-name-xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.appname.macos.app-name-xpc was invalidated: failed at lookup with error 3 - No such process.} Here's what I have verified so far: The XPC service has the correct CFBundleIdentifier and is located within the Contents/XPCServices directory of my app's bundle. Info.plist for the XPC service has ServiceType set to Bundled. The XPC service target's Installation Directory is the default location for XPC services (@executable_path/../XPCServices). Code signing and entitlements have been verified for both the main app and the XPC service, and disabling the sandbox doesn't resolve the issue. The main app and XPC service are part of the same App Group, and both have the App Sandbox capability enabled. Here's a snippet of the Swift code that establishes the XPC connection: let xpcConnection = NSXPCConnection(serviceName: "com.appname.macos.app-name-xpc") xpcConnection.remoteObjectInterface = NSXPCInterface(with: ServiceProtocol.self) xpcConnection.resume() And here's the ServiceProtocol for reference: @objc public protocol ServiceProtocol: NSObjectProtocol { @objc func executeUnixExecutable(arguments: [String], completionHandler: @escaping (ResultType) -> Void) func interruptUnixExecutable() func closeUnixExecutablePipes() } When I run the app, the connection is invalidated without any further details as to why. I'm not sure if I'm missing a configuration step or if there's an issue with my XPC service setup. Has anyone experienced this issue or have suggestions on what else I can check to resolve this?
Posted
by
Post not yet marked as solved
5 Replies
717 Views
I am currently writing an agent for endpoint security. I cannot connect the application and the xpc service. I start the plist with launchctl and then open the application, but it does not connect and the application runs dysfunctionally. I leave the code of the ViewController in the application and the XPCConnection in the xpc service below. Note: I create the XPC service in Xcode like a normal application and write it as a service application with "Application is background only" ViewController.swift func establishConnection() { XPCConnection.shared.connectToDaemon(bundle: Bundle.main, delegate: self) { success in DispatchQueue.main.async { [self] in if !success { controlButton.isEnabled = false configMenuStatus(start: false, stop: false) alertWithError(error: "Unable to start monitoring for broken connection with daemon.") } else { Logger(.Info, "Connect to daemon successfully.") } } } } XPCConnection.swift func connectToDaemon(bundle: Bundle, delegate: ClientXPCProtocol, handler: @escaping (Bool) -> Void) { guard connection == nil else { Logger(.Info, "Client already connected.") handler(true) return } guard getMachServiceName(from: bundle) == ClientBundle else { handler(false) return } let newConnection = NSXPCConnection(machServiceName: DaemonBundle) newConnection.exportedObject = delegate newConnection.exportedInterface = NSXPCInterface(with: ClientXPCProtocol.self) newConnection.remoteObjectInterface = NSXPCInterface(with: DaemonXPCProtocol.self) newConnection.invalidationHandler = { self.connection = nil Logger(.Info, "Daemon disconnected.") handler(false) } newConnection.interruptionHandler = { self.connection = nil Logger(.Error, "Daemon interrupted.") handler(false) } connection = newConnection newConnection.resume() let proxy = newConnection.remoteObjectProxyWithErrorHandler { error in Logger(.Error, "Failed to connect with error [\(error)]") self.connection?.invalidate() self.connection = nil handler(false) } as? DaemonXPCProtocol proxy!.connectResponse(handler) handler(true) } This is the error photo, the application continues to work First, I checked to see if I had made a mistake in the bundle identifier, but I could not find an error, and then I realized that I had not run the launchd service. Then I ran it, but it did not make any sense. What I am trying to do is to connect and run the network extension and endpoint security with this service, but the xpc service does not connect to each other.
Posted
by
Post not yet marked as solved
2 Replies
415 Views
I have another NSXPC problem, and the problem goes like this NSXPC server implements an interface -(void) callbackWithInfo:(NSDictionary*)log reply:(void (^)(bool))action; The NSXPC client implements a method that will call the interface in a loop and perform a timeout operation. If the server returns to the interface and does not call the action after 1s, the client will perform subsequent operations. The callbackWithInfo interface is then called again, and the cycle continues. client code: The general structure is as follows while(true){ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [serverProxy callbackWithInfo:InfoDic reply:^(bool action) { if(flag != NO){ flag = action; } }]; dispatch_semaphore_signal(semaphore); }); if(dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, self.waitTime *NSEC_PER_MSEC)) != 0){ NSLog(@"flag: %d", flag); } sleep(0.1); } If the action callback is not invoked on the server, the number of FDS on the client increases. As a result, the process cannot open the file, or too much program context information is generated. As a result, the NSXPC interface fails to be invoked. Now I can not operate on the server side, how can the client side implement the code to ensure that the action will not be punished, and the fd will not increase.
Posted
by
Post not yet marked as solved
1 Replies
414 Views
I implemented an NSXPC for inter-process data transfer, and the data transferred is NSDictionary. However, a crash occurred during transmission. The corresponding crash logs are as follows Thread 16 Crashed:: Dispatch queue: xpc.test.queue 0 libobjc.A.dylib 0x1945a24d0 objc_retain + 16 1 Foundation 0x1956b7764 -[NSDictionary(NSDictionary) encodeWithCoder:] + 604 2 Foundation 0x195686d9c -[NSXPCEncoder _encodeObject:] + 520 3 Foundation 0x19568c154 _NSXPCSerializationAddInvocationWithOnlyObjectArgumentsArray + 120 4 Foundation 0x19568c000 -[NSXPCEncoder _encodeInvocationObjectArgumentsOnly:count:typeString:selector:isReply:into:] + 212 5 Foundation 0x195684f98 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 1448 6 Foundation 0x19568d584 -[NSXPCConnection _sendSelector:withProxy:arg1:] + 132 7 Foundation 0x19568d4a8 _NSXPCDistantObjectSimpleMessageSend1 + 68 8 TestDemo 0x1041e9308 0x104184000 + 414472 9 libdispatch.dylib 0x1945565f0 _dispatch_call_block_and_release + 32 10 libdispatch.dylib 0x1945581b4 _dispatch_client_callout + 20 11 libdispatch.dylib 0x19455f8a8 _dispatch_lane_serial_drain + 668 12 libdispatch.dylib 0x194560404 _dispatch_lane_invoke + 392 13 libdispatch.dylib 0x19456ac98 _dispatch_workloop_worker_thread + 648 14 libsystem_pthread.dylib 0x194718360 _pthread_wqthread + 288 15 libsystem_pthread.dylib 0x194717080 start_wqthread + 8 want to know if there is any way to check if NSDictionary data is transferable, NSDictionary data is generated dynamically, and the assignment method used is Info[@ "baseInfo"] = ***. Is this method necessary to determine whether *** is not nil?
Posted
by
Post not yet marked as solved
3 Replies
924 Views
I implemented a multithreaded app, but there was a thread-related crash in the app, I don't understand why this happened, the corresponding stack trace is as follows. Thread 15 Crashed:: Dispatch queue: com.apple.root.default-qos 0 libsystem_kernel.dylib 0x1a849ad98 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1a84cfee0 pthread_kill + 288 2 libsystem_c.dylib 0x1a840a340 abort + 168 3 libc++abi.dylib 0x1a848ab08 abort_message + 132 4 libc++abi.dylib 0x1a847a950 demangling_terminate_handler() + 336 5 libobjc.A.dylib 0x1a8370320 _objc_terminate() + 144 6 libc++abi.dylib 0x1a8489ea4 std::__terminate(void (*)()) + 20 7 libc++abi.dylib 0x1a8489e40 std::terminate() + 64 8 libdispatch.dylib 0x1a830c1c8 _dispatch_client_callout + 40 9 libdispatch.dylib 0x1a831da04 _dispatch_root_queue_drain + 680 10 libdispatch.dylib 0x1a831e104 _dispatch_worker_thread2 + 164 11 libsystem_pthread.dylib 0x1a84cc324 _pthread_wqthread + 228 12 libsystem_pthread.dylib 0x1a84cb080 start_wqthread + 8
Posted
by
Post not yet marked as solved
14 Replies
1.5k Views
Hi team, We found that the app reported a lot of crash stacks, and the top of the stack had the libxpc library feature, but we could not find the reason. These issues have only emerged since iOS 16 and are growing, can you provide some clues or provide some solutions? Thanks! Crash backtrace can be seen as follows. _ OS Version: 16.6.1 (20G81) Report Version: 104 SDK start time: 2023-09-20 18:42:40 RDM SDK Version: 2.7.27.1 RDM user id : 119902290602 RDM DeviceId: 0DB20076-F323-468F-9EEC-080B77A00E05 RDM APP KEY: 7c35edbf90 Last Exception : 0 libxpc.dylib 0x000000020a019e98 __xpc_dictionary_insert + 96 1 libxpc.dylib 0x000000020a019e84 __xpc_dictionary_insert + 76 2 libxpc.dylib 0x000000020a01b944 __xpc_dictionary_deserialize_apply + 68 3 libxpc.dylib 0x000000020a01b8cc __xpc_dictionary_apply_wire_f + 136 4 libxpc.dylib 0x000000020a018da4 __xpc_dictionary_deserialize + 108 5 libxpc.dylib 0x000000020a00cdf4 __xpc_array_deserialize + 204 6 libxpc.dylib 0x000000020a01b9ec __xpc_dictionary_unpack_value + 120 7 libxpc.dylib 0x000000020a01bbf0 __xpc_dictionary_unpack_value_and_vend + 28 8 libxpc.dylib 0x000000020a01a4c4 __xpc_dictionary_look_up + 156 9 libxpc.dylib 0x000000020a01b094 _xpc_dictionary_get_array + 20 10 libdns_services.dylib 0x000000020a0b9a28 ____dnssd_client_connection_block_invoke_2 + 320 11 libxpc.dylib 0x000000020a015af0 __xpc_connection_call_event_handler + 152 12 libxpc.dylib 0x000000020a015f20 __xpc_connection_mach_event + 992 13 libdispatch.dylib 0x00000001b1657f6c __dispatch_client_callout4 + 20 14 libdispatch.dylib 0x00000001b16746ec __dispatch_mach_msg_invoke + 468 15 libdispatch.dylib 0x00000001b165f40c __dispatch_lane_serial_drain + 372 16 libdispatch.dylib 0x00000001b1675438 __dispatch_mach_invoke + 448 17 libdispatch.dylib 0x00000001b165f40c __dispatch_lane_serial_drain + 372 18 libdispatch.dylib 0x00000001b16600a4 __dispatch_lane_invoke + 384 19 libdispatch.dylib 0x00000001b166acdc __dispatch_workloop_worker_thread + 648 20 libsystem_pthread.dylib 0x0000000209fc1ddc __pthread_wqthread + 288 Exception Type: SIGSEGV SEGV_ACCERR Exception Codes: fault addr: 0x0000000000000036 Crashed Thread: 7 _
Posted
by
Post not yet marked as solved
0 Replies
453 Views
Hi team, We found that the app reported a lot of crash stacks, and the top of the stack had the libxpc library feature, but we could not find the reason. These issues have only emerged since iOS 16 and are growing, can you provide some clues or provide some solutions? Thanks Crash backtrace can be seen as follows. _ OS Version: 16.6.1 (20G81) Report Version: 104 SDK start time: 2023-09-20 18:42:40 RDM SDK Version: 2.7.27.1 RDM user id : 119902290602 RDM DeviceId: 0DB20076-F323-468F-9EEC-080B77A00E05 RDM APP KEY: 7c35edbf90 Last Exception : 0 libxpc.dylib 0x000000020a019e98 __xpc_dictionary_insert + 96 1 libxpc.dylib 0x000000020a019e84 __xpc_dictionary_insert + 76 2 libxpc.dylib 0x000000020a01b944 __xpc_dictionary_deserialize_apply + 68 3 libxpc.dylib 0x000000020a01b8cc __xpc_dictionary_apply_wire_f + 136 4 libxpc.dylib 0x000000020a018da4 __xpc_dictionary_deserialize + 108 5 libxpc.dylib 0x000000020a00cdf4 __xpc_array_deserialize + 204 6 libxpc.dylib 0x000000020a01b9ec __xpc_dictionary_unpack_value + 120 7 libxpc.dylib 0x000000020a01bbf0 __xpc_dictionary_unpack_value_and_vend + 28 8 libxpc.dylib 0x000000020a01a4c4 __xpc_dictionary_look_up + 156 9 libxpc.dylib 0x000000020a01b094 _xpc_dictionary_get_array + 20 10 libdns_services.dylib 0x000000020a0b9a28 ____dnssd_client_connection_block_invoke_2 + 320 11 libxpc.dylib 0x000000020a015af0 __xpc_connection_call_event_handler + 152 12 libxpc.dylib 0x000000020a015f20 __xpc_connection_mach_event + 992 13 libdispatch.dylib 0x00000001b1657f6c __dispatch_client_callout4 + 20 14 libdispatch.dylib 0x00000001b16746ec __dispatch_mach_msg_invoke + 468 15 libdispatch.dylib 0x00000001b165f40c __dispatch_lane_serial_drain + 372 16 libdispatch.dylib 0x00000001b1675438 __dispatch_mach_invoke + 448 17 libdispatch.dylib 0x00000001b165f40c __dispatch_lane_serial_drain + 372 18 libdispatch.dylib 0x00000001b16600a4 __dispatch_lane_invoke + 384 19 libdispatch.dylib 0x00000001b166acdc __dispatch_workloop_worker_thread + 648 20 libsystem_pthread.dylib 0x0000000209fc1ddc __pthread_wqthread + 288 Exception Type: SIGSEGV SEGV_ACCERR Exception Codes: fault addr: 0x0000000000000036 Crashed Thread: 7 _
Posted
by
Post not yet marked as solved
1 Replies
810 Views
I randomly get this crash in my webview application when loading data. There is no pattern to it, it can happen in all areas where images are being loaded into vram. Here is the error: 2023-09-16 19:57:55.404378+0200 Bluelife[3284:194440] [Process x10d004350 - [PID=3445] WebProcessProxy: :didClose: (web process 0 crash) 2023-09-16 19:57:55.404500+0200 Bluelife3284:194440] [Process] 0x10d004350 - [PID=3445 WebProcessProxy::processDidTerminate0rFailedToLaunch: reason=Crash 2023-09-16 19:57:55.404579+0200 Bluelife[3284:194440] [ProcessSuspension] 0x10c01dfe - ProcessAssertion: Failed to acquire RBS Background assertion 'XPCConnectionTerminationWatchdog' for process because PID 0 is invalid 2023-09-16 19:57:55.410251+0200 Bluelife[3284:194440] [Process] 0x130856218 - [pageProxyID=14, webPageID=15, PID=3445] WebPageProxy: :processDidTerminate: (pid 3445), reason=Crash 2023-09-16 19:57:55.411392+0200 Bluelife[3284:211863] [ProcessSuspension] 0x10c01dfe - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=0, error: (null) 2023-09-16 19:57:55.424321+0200 Bluelife[3284:194440] [Loading] 0x130856218 - [pageProxID=14, webPageID=15, PID=3445] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
Posted
by
Post not yet marked as solved
3 Replies
478 Views
Hello, I encountered such a problem, the scenario is like this: I have a launchctl startup daemon called xpcserver.app, which uses NSXPC to start an xpc Server. There is a Client program that links to the nsxpc service of this xpcserver.app, and when I establish the connection, I call an interface implemented by xpcserver named setName:(nsstring*)name. I was sure that my xpcserver implemented the corresponding interface, but when the client called the interface to pass the value, it triggered the error "unrecognized selector sent to instance". When I restarted the client, the call to the interface successfully implemented the function. May I ask why? Using the NSXPC started service, hope to solve, thank you
Posted
by
Post marked as solved
4 Replies
761 Views
Assume this over-simplified @protocol I'm using for my XPC-service: @protocol MyMinimalProtocol <NSObject> - (void)getStatusWithReply:(void (^ _Nullable)(NSDictionary * _Nonnull))reply; @end The Client side would then NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:myServiceLabel options:NSXPCConnectionPrivileged]; connection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyMinimalProtocol)]; connection.interruptionHandler = ^{ NSLog(@"XPC: connection - interrupted"); }; connection.invalidationHandler = ^{ NSLog(@"XPC: connection - invalidated"); }; [connection resume]; [connection.remoteObjectProxy getStatusWithReply:^(NSDictionary * response) { NSLog(@"XPC service status received - %@", response); }]; So far - so good. My XPC service receives the asynchronous call, schedules it's "status gathering operation" on internal background queue, and returns. Later - when information is available, my XPC service executes the reply-block then, on the remote calling side - I see the log line with the status, as expected. BUT!!! If I add another different code-block argument to the method e.g. @protocol MyMinimalProtocol <NSObject> - (void)getStatusWithReply:(void (^ _Nullable)(NSDictionary * _Nonnull))reply andFailureBlock:(void (^ _Nullable)(NSError * _Nonnull))failureBlock; @end Then all hell breaks loose. Both XPC service and the client crash with hilarious crash reasons I can't decipher. Here's "Client side" caller crash (excerpt - forgive the methods are NOT the simplified ones above) XPC Client(Caller) side crash - excerpt while on the "XPC Service" side, crashes like these: XPC service side crash excerpt I wonder if there's something inherently wrong with having two code-block arguments for an XPC remote method? Another issue. The client XPC calls are asynchronous. They return immediately. The XPC service implementing the remote-call also returns immediately - and it executes the "reply block" far (a minute!) later, on another queue. However, if the XPC service attempts to execute the code-block MORE THAN ONCE, then the client-side code-block is only called ONCE. rest of the executions look benign in the XPC-service side - but never happen on the calling (client) side. Any idea why? can this be overcome? Any thoughts/ideas/references to documentation will be greatly appreciated. I couldn't find any good source on this. Thanks.
Posted
by
Post not yet marked as solved
1 Replies
328 Views
I have a NSXPCListener in an app and like to connect to from a command line tool. I can’t get it to work so I wonder if it is not supported of if I miss something. Any help is greatly appreciated.
Posted
by
Post not yet marked as solved
5 Replies
637 Views
Hello, I'm struggling to understand how I can use NSXPC API to communicate between two processes on iOS. The problem which I want to solve is how to pass some information from VPN tunnel to the VPN app. I'm looking at the XPC documentation and for iOS I can create NSXPCListener only with the following functions: service() anonymous() Both return NSXPCListener instance. But the question remains, how to connect to such an instance? In NSXPConnection API I see only one option for iOS: init(listenerEndpoint: NSXPCListenerEndpoint) Other constructors accepting serviceName or machServiceName are available only form macOS. I feel like the problem of communicating between two processes should be easy, but surprisingly I did find it quite difficult on iOS. Can you please advice if this is a proper API for my use case? Or maybe is there some better one, which I'm not aware of? If this is a proper API, how should I create a connection between two apps? How to pass a listener from one process to the other?
Posted
by
Post marked as solved
1 Replies
630 Views
I have a regular GUI-based app that communicates with an Endpoint System Extension installed by another app. Both the GUI app and Endpoint System Extension have the same Team ID and are part of the same App Groups. But I still need to do one of the following to the GUI-based app to allow it to communicate with the Endpoint System Extension over XPC: Disable the sandbox Add com.apple.security.temporary-exception.mach-lookup.global-name to entitlements For some reason I thought there was another way to resolve this. Am I missing anything? (My goal is to allow an app distributed through the Mac App Store to communicate with my Endpoint System Extension if it exists, and I am worried about the "temporary-exception" entitlement needed to support this.)
Posted
by
Post not yet marked as solved
1 Replies
569 Views
Hi! First time using XPC on a Mac app, and I'm stuck on a problem I can't understand. I have an app with multiple frameworks, and I'm adding an XPC service to one of the pre-existing frameworks. Right now the service is just the template that uppercases a string. I took all the necessary steps, I believe (adding the service as a target dependency, and copying it to the XPC Services folder). However, when I run it in Debug mode, I always get: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named <fully qualified service bundle ID> was invalidated: failed at lookup with error 3 - No such process." I also tested on a different, pre-existing framework, and the same thing happens. Here's the weird parts: if I create a new framework and follow exactly the same steps, it works. I've compare the build settings between both frameworks and everything seems similar. And if I run in Release mode, the original service on the problematic framework also works! If I create a project with similar setup (app + framework with service inside it), it also works. Looking at Console.app, I don't see anything that explains what's happening, but I may be filtering for the wrong thing. Any help on why this fails specifically on my pre-existing frameworks and only on Debug mode is much appreciated. :) Thank you, Miguel Arroz
Posted
by
Post not yet marked as solved
1 Replies
782 Views
We have 2 process in our macOS application Daemon process written in golang Swift application Currently, the communication between both the process are done with Unix domain socket. However, we are seeing significant amount of delay when large amount of data communication. We are looking for some faster communication. Probably XPC is the answer. But not sure how to use XPC between two process which are written in different language. Any sample code would be great help.
Posted
by
Post not yet marked as solved
5 Replies
828 Views
Hello! I'm new here, and probably this will sound weird but, I'm trying to write a C++ program using an XPC service to attempt to communicate with a macOS app I'm developing in Swift. At the macOS app side I think I'm successfully registering and connecting to the service, as launchd reports the following in its log: 2023-05-31 17:20:21.898621 (pid/15637 [On Air]) <Notice>: Service stub created for com.ruieduardolopes.onaird-join At the C++ side I'm trying to get a simple example working, as follows, but currently without any success... #include <xpc/xpc.h> int main(int argc, const char* argv[]) { xpc_connection_t conn = xpc_connection_create_mach_service("com.ruieduardolopes.onaird.join", NULL, 0); xpc_object_t message = xpc_dictionary_create(NULL, NULL, 0); xpc_connection_set_event_handler(conn, ^(xpc_object_t object) {}); xpc_connection_resume(conn); xpc_dictionary_set_string(message, "SS", "AAAAAA\n"); xpc_connection_send_message_with_reply(conn, message, dispatch_get_main_queue(), ^(xpc_object_t object) {}); return (EXIT_SUCCESS); } I get the following error in the logs: 2023-05-31 17:27:45.636894 (system/com.ruieduardolopes.onaird) <Notice>: internal event: WILL_SPAWN, code = 0 2023-05-31 17:27:45.636903 (system/com.ruieduardolopes.onaird) <Notice>: service state: spawn scheduled 2023-05-31 17:27:45.636904 (system/com.ruieduardolopes.onaird) <Notice>: service state: spawning 2023-05-31 17:27:45.637017 (system/com.ruieduardolopes.onaird) <Notice>: launching: ipc (mach) 2023-05-31 17:27:45.637256 (system/com.ruieduardolopes.onaird [15908]) <Notice>: xpcproxy spawned with pid 15908 2023-05-31 17:27:45.637264 (system/com.ruieduardolopes.onaird [15908]) <Notice>: internal event: SPAWNED, code = 0 2023-05-31 17:27:45.637265 (system/com.ruieduardolopes.onaird [15908]) <Notice>: service state: xpcproxy 2023-05-31 17:27:45.637269 (system/com.ruieduardolopes.onaird [15908]) <Notice>: internal event: SOURCE_ATTACH, code = 0 2023-05-31 17:27:45.648927 (system/com.ruieduardolopes.onaird [15908]) <Notice>: service state: running 2023-05-31 17:27:45.648940 (system/com.ruieduardolopes.onaird [15908]) <Notice>: internal event: INIT, code = 0 2023-05-31 17:27:45.648948 (system/com.ruieduardolopes.onaird [15908]) <Notice>: Successfully spawned onaird-join[15908] because ipc (mach) 2023-05-31 17:27:45.687251 (system/com.ruieduardolopes.onaird [15908]) <Notice>: exited due to SIGTRAP | sent by exc handler[15908] 2023-05-31 17:27:45.687261 (system/com.ruieduardolopes.onaird [15908]) <Notice>: service has crashed 1 times in a row 2023-05-31 17:27:45.687263 (system/com.ruieduardolopes.onaird [15908]) <Notice>: service state: exited 2023-05-31 17:27:45.687267 (system/com.ruieduardolopes.onaird [15908]) <Notice>: internal event: EXITED, code = 0 2023-05-31 17:27:45.687269 (system) <Notice>: service inactive: com.ruieduardolopes.onaird 2023-05-31 17:27:45.687281 (system/com.ruieduardolopes.onaird [15908]) <Notice>: service state: not running 2023-05-31 17:27:45.687290 (system/com.ruieduardolopes.onaird) <Notice>: Service only ran for 0 seconds. Pushing respawn out by 10 seconds. 2023-05-31 17:27:45.687339 (system/com.ruieduardolopes.onaird) <Notice>: internal event: WILL_SPAWN, code = 0 2023-05-31 17:27:45.687343 (system/com.ruieduardolopes.onaird) <Notice>: service state: spawn scheduled 2023-05-31 17:27:45.687344 (system/com.ruieduardolopes.onaird) <Notice>: service throttled by 10 seconds The plist file I'm currently loading to /Library/LaunchDaemons is as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.ruieduardolopes.onaird</string> <key>Program</key> <string>PATH_TO_ONAIR_JOIN_XPC_SERVICE_BINARY</string> <key>BuildMachineOSBuild</key> <string>22C65</string> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> <string>onaird-join</string> <key>CFBundleExecutable</key> <string>onaird-join</string> <key>CFBundleIdentifier</key> <string>com.ruieduardolopes.onaird-join</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>onaird-join</string> <key>CFBundlePackageType</key> <string>XPC!</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>MacOSX</string> </array> <key>CFBundleVersion</key> <string>1</string> <key>DTCompiler</key> <string>com.apple.compilers.llvm.clang.1_0</string> <key>DTPlatformBuild</key> <string></string> <key>DTPlatformName</key> <string>macosx</string> <key>DTPlatformVersion</key> <string>13.3</string> <key>DTSDKBuild</key> <string>22E245</string> <key>DTSDKName</key> <string>macosx13.3</string> <key>DTXcode</key> <string>1430</string> <key>DTXcodeBuild</key> <string>14E222b</string> <key>LSMinimumSystemVersion</key> <string>13.1</string> <key>MachServices</key> <dict> <key>com.ruieduardolopes.onaird.join</key> <true/> </dict> <key>XPCService</key> <dict> <key>ServiceType</key> <string>Application</string> </dict> </dict> </plist> Can anybody help me? Thanks in advance, Rui
Post not yet marked as solved
1 Replies
1k Views
I am working as an iOS Developer since 2 years. I am getting log on console like: [MADService] Client XPC connection invalidated sometimes. I am unable to get when and for what reason i am getting this. need some help. Thank you
Posted
by
Post not yet marked as solved
4 Replies
4.9k Views
Hello everyone, With the MacOS update to Venture 13.2, I get the following error message when closing a MacOS app in xCode: [client] No error handler for XPC error: Connection invalid Today I set up a brand new MacOS system which has nothing more installed as except for MacOS Venture 13.2 and xCode 14.2 (14C18). The error already occurs when I start an app that only contains template code. I also started the app without xCode and then closed it through the menu. Then I do not receive an error message. With the Ventura version 13.1 on an AirBook with M1, the problem did not exist. On my Intel iMac, the error causes the iMac to no longer start normally. Thank you very much for your support.
Posted
by
Post not yet marked as solved
0 Replies
1.5k Views
XPC is the preferred inter-process communication (IPC) mechanism on Apple platforms. XPC has three APIs: The high-level NSXPCConnection API, for Objective-C and Swift The low-level Swift API, introduced with macOS 14 The low-level C API, which, while callable from all languages, works best with C-based languages General: DevForums tag: XPC Creating XPC services documentation NSXPCConnection class documentation Low-level API documentation XPC has extensive man pages — For the low-level API, start with the xpc man page; this is the original source for the XPC C API documentation and still contains titbits that you can’t find elsewhere. Also read the xpcservice.plist man page, which documents the property list format used by XPC services. Daemons and Services Programming Guide archived documentation WWDC 2012 Session 241 Cocoa Interprocess Communication with XPC — This is no longer available from the Apple Developer website )-: Technote 2083 Daemons and Agents — It hasn’t been updated in… well… decades, but it’s still remarkably relevant. TN3113 Testing and Debugging XPC Code With an Anonymous Listener XPC and App-to-App Communication DevForums post Validating Signature Of XPC Process DevForums post Related tags include: Inter-process communication, for other IPC mechanisms Service Management, for installing and uninstalling Service Management login items, launchd agents, and launchd daemons Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
Posted
by