Questions tagged [xpc]

XPC is a low level library that simplifies inter process communication (IPC) on iOS and OS X.

178 questions
6
votes
1 answer

iOS Pasteboard strange random crash

Our app received the crash multi times due to use Pasteboard. Under this situation when I try to use system Notes paste the content, the system notes will block too. So I write a program try to read the pasteboard, but it will also crash when I use…
afei
  • 123
  • 1
  • 11
6
votes
0 answers

Which NSXPCConnection related objects do I have to retain myself?

I cannot find any hint in the docs regarding object lifecycle management. In the XPC service, do I have to keep a strong reference to the NSXPCListener, or does the resume call take care of this effectively? I'm using Swift and a connection…
ctietze
  • 2,805
  • 25
  • 46
6
votes
2 answers

Security Scoped Bookmark in App Extension

I am creating a TodayWidget app extension which displays information about user selected folders outside the application directory. In my main application I am able to use powerbox via NSOpenPanel to select the folder. I can then save a security…
duncanc4
  • 1,191
  • 1
  • 9
  • 17
6
votes
1 answer

Alternatives to XPC Service

I am trying to port Wine 1.7.13 to modern Cocoa. I am considering running Windows binaries in an XPC service’s process, for security isolation and crash-proofing. However, there is one problem: To the best of my knowledge, XPC services are…
wjk
  • 1,219
  • 11
  • 27
6
votes
1 answer

XPC test bundle on Xcode 5

I have Cocoa application with custom XPC service. I would like to create tests for that XPC, so I created new test bundle for that and created some tests. But when I run those tests (whose doesn't show any error in Xcode), IDE is not able to link…
5
votes
1 answer

NSXPCInterface constructor does not recognise protocol in Swift

I'm creating a XPC service in swift, and I created my protocol: protocol MyProtocol { func myFunc() } When I try to set the interface that the exported object implements (in my main.swift), by initialising a new object of NSXPCInterface with…
gbdavid
  • 1,639
  • 18
  • 40
5
votes
1 answer

How to Terminate/Reset an bundle XPC helper?

Does anyone know how to terminate or reset an XPC helper? According to the Apple documentation, launchd takes care of the XPC helper if it crashes. But there is no indication of what to do, if you need to interrupt or cancel a running helper. For…
5
votes
3 answers

XPC not creating any processes for XPC services

I'm trying to create an XPC service, but the service doesn't seem to being created. In my service's main method, the first thing I do is make some calls to syslog so that I can see if the service ever starts running. These log messages never appear…
James Bedford
  • 28,702
  • 8
  • 57
  • 64
4
votes
3 answers

How do you make a Swift class available in an XPC service?

I'm attempting to rebuild Apple's XPC "lowerCase" sample code from Objective-C to Swift. I understand XPC will, but I'm relatively new to Swift and Objective-C interoperability. When I use their exact sample code, which passes a String from the app…
kennyc
  • 5,490
  • 5
  • 34
  • 57
4
votes
1 answer

XPC and Exception handling

I have an LaunchAgent using HockeyApp for crash reporting. Now I noticed that uncaught exception where not reported by HockeyApp, like they would have been in a normal macOS app. For example: - (void)upperCaseString:(NSString *)aString…
catlan
  • 25,100
  • 8
  • 67
  • 78
4
votes
3 answers

Verify that a helper tool is installed

I'm writing a macOS app in Swift that needs a privileged helper tool -- wish the elevation wasn't necessary, but it looks like it is. I found this excellent example application especially tailored for this scenario. I've managed to port its code to…
swineone
  • 2,296
  • 1
  • 18
  • 32
4
votes
1 answer

NSMachBootstrapServer is deprecated, how can NSXPCConnection be used to register a Mach Service?

I need to write a Mach Service that both my app and a system plugin can talk to, I use the NSMachPort API to create a new port, then register it with NSMachBootstrapServer: - (void) run { NSMachPort *serverPort = (NSMachPort *)[NSMachPort…
alfwatt
  • 2,010
  • 2
  • 18
  • 29
4
votes
1 answer

Is it possible to use pyobjc with a privilved XPC helper tool and XPCInterface API?

I believe the answer to this question is "no", but I'm putting it out to the community just in case someone has been more successful than I have. I have a privileged helper tool that a client Cocoa application uses with the NSXPCConnection and…
Corbell
  • 1,283
  • 8
  • 15
4
votes
2 answers

Getting the "real" parent process in case process spawned indirectly using launchd

I'm maintaining an OSX tool that reveal the parents tree of a selected process from the direct parent to its earliest ancestor (usually launchd). However, this process chain may break if the examined process has indirectly spawned from launchd…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
4
votes
0 answers

Passing objects with circular reference to XPC services

I would like to pass objects with circular to an XPC service. Let's say that I have an object class Course a Teacher and an array of Student. Student have also a reference to the Teacher. The XPC protocol signatures contain any combination of the…
Martin Delille
  • 11,360
  • 15
  • 65
  • 132
1 2
3
11 12