Hello, I'm having some problems when install my Packet Tunnel network extension as system extension on my mac(macos 15.0). It stuck on Validation By Category. (it works well as NE app extension on ios)
systemextensionsctl list
--- com.apple.system_extension.network_extension
enabled active teamID bundleID (version) name [state]
<...> com.myteam.balabalabla.ne (1.0/1) - [validating by category]
This is my install System Extension Code sample
public class SystemExtension: NSObject, OSSystemExtensionRequestDelegate {
private let forceUpdate: Bool
private let inBackground: Bool
private let semaphore = DispatchSemaphore(value: 0)
private var result: OSSystemExtensionRequest.Result?
private var properties: [OSSystemExtensionProperties]?
private var error: Error?
private init(_ forceUpdate: Bool = false, _ inBackground: Bool = false) {
}
// some request function i overwrite
public func activation() throws -> OSSystemExtensionRequest.Result? {
let request = OSSystemExtensionRequest.activationRequest(forExtensionWithIdentifier: FilePath.packageName + ".myNeName", queue: .main)
request.delegate = self
OSSystemExtensionManager.shared.submitRequest(request)
semaphore.wait()
if let error {
throw error
}
return result
}
public func getProperties() throws -> [OSSystemExtensionProperties] {
let request = OSSystemExtensionRequest.propertiesRequest(forExtensionWithIdentifier: FilePath.packageName + ".myNeName", queue: .main)
request.delegate = self
OSSystemExtensionManager.shared.submitRequest(request)
semaphore.wait()
if let error {
throw error
}
return properties!
}
public nonisolated static func install(forceUpdate: Bool = false, inBackground: Bool = false) async throws -> OSSystemExtensionRequest.Result? {
try await Task.detached {
try SystemExtension(forceUpdate, inBackground).activation()
}.result.get()
}
public nonisolated static func uninstall() async throws -> OSSystemExtensionRequest.Result? {
try await Task.detached {
try SystemExtension().deactivation()
}.result.get()
}
}
// And other methods
I follow this post Your Friend the System Log and use this command line to collect log. After I initiated the system extension request sudo log collect --last 5m
Here is my log (),I only pasted some code snippets that caught me, full version see attachments.(only include com.apple.sysextd), if need more, plz ask me.
1. Some policy missing
```log
22:00:13.818257 `sysextd` extension mockTeamID app.balabala.com.mockbalabala (1.0/1) advancing state from staging to validating
22:00:13.818263 sysextd returning cdhash for local arch arm64 of extension app.balabala.com.mockbalabala
info 2025-05-01 22:00:13.818336 sysextd Extension with identifier <private> reached state <private>
22:00:13.819185 sysextd [0x9a2034b00] activating connection: mach=false listener=false peer=false name=com.apple.CodeSigningHelper
22:00:13.819911 sysextd [0x9a2034b00] invalidated after the last release of the connection object
22:00:13.821024 sysextd making activation decision for extension with teamID teamID("mockTeamID ), identifier app.balabala.com.mockbalabala
22:00:13.821026 sysextd no related kext found for sysex `app.balabala.com.mockbalabala`
22:00:13.821027 sysextd no extension policy -- activation decision is UserOption
nesessionmanager.system-extensions interrupted
22:00:14.313576 sysextd [0x9a2178280] invalidated because the client process (pid 1886) either cancelled the connection or exited
22:00:14.542154 sysextd connection to com.apple.nesessionmanager.system-extensions interrupted
22:00:14.542319 sysextd [0x9a2178000] Re-initialization successful; calling out to event handler with XPC_ERROR_CONNECTION_INTERRUPTED
22:00:14.542351 sysextd connection to com.apple.nesessionmanager.system-extensions interrupted
22:00:14.589375 nesessionmanager [0x6c80e4500] activating connection: mach=true listener=false peer=false name=com.apple.sysextd
And when i debug the System Extension code i notice the request Error catch by didFailWithError
public func request(_: OSSystemExtensionRequest, didFailWithError error: Error) {
self.error = error
semaphore.signal()
}
error is
OSSystemExtensionErrorDomain code 1
This problem has been bothering me for a long time, I would appreciate any help, if need more info, comment, thank you.
I explain the validating by category
issue in this thread, starting at this post. I’m not sure that’ll be enough to get you fully unstuck, but it’s a place to start.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"