Post

Replies

Boosts

Views

Activity

Reply to Univeral installer for M1/Intel app
why? The easiest thing to do is build a Universal application, at some (usually small cost) to the user in disk space. If you really must do this, you'll need to read up on the documentation for installers: https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW7 and consult the man pages for pkgbuild and/or productbuild. Somewhere in there, you'll probably find that you can restrict what is installed based on arch.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’22
Reply to is XPC from app to CMIOExtension possible?
As we learned in the "Create camera extensions with CoreMedia IO" presentation at WWDC 2022, a Camera Extension can present a sink interface to the system, accessible to an app via the CMIOHardwareObject.h and CMIOHardwareStream.h APIs. The Camera Extension template only offers a source stream, but it is pretty easy to add a sink stream. That's one way to get video into a Camera Extension, it works on 12.3 and it doesn't require a helper daemon to enable the app and extension to find one another. In Ventura, the plan is to have the app's extension be owned by the app's owner, so XPC would be an option. Easier again is to have the extension itself handle the video sourcing, while the accompanying app only provides control and status reporting, using the property interfaces of the extension. That's the intent behind the design.
Topic: App & System Services SubTopic: Drivers Tags:
Jun ’22
Reply to is XPC from app to CMIOExtension possible?
I'll type this in the answer box then. If you can require 10.12 or later, it is much simpler than this. As I found out, an IOSurfaceRef cannot be directly transported over NSXPCConnection, but an IOSurface can. No need to do the CreateXPCObject or LookupFromXPCObject stuff unless you're on 10.7 to 10.11. The two types are toll-free bridged. The only thing I'm not sure about is which flavor of __bridge to use at each end. I'm thinking I need write IOSurfaceRef surface = CVPixelBufferGetIOSurface(pixelBuffer); [remoteObjectProxy sendIOSurfaceToExtension:(__bridge_transfer IOSurface *)surface]; and at the receiving end CVPixelBufferRef pixelBuffer; CFPixelbufferCreateWithIOSurface(kCFAllocatorDefault, (__bridge_retained IOSurfaceRef)surface,...); I guess I'll find out...
Topic: App & System Services SubTopic: Drivers Tags:
May ’22
Reply to Xcode problem on MAC M1 Monterrey
You have a clean (new) install of macOS 12.3.1. It doesn't have python. https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes Search the interweb to find why 'python' doesn't usually resolve automatically to python3, and the various ways you can install multiple versions of python on your machine. I use pyenv.
May ’22
Reply to Programmatically Change Default Application to Open a File With
from NSWorkspace.h (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenContentTypeOfFileAtURL:(NSURL *)url completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0)); before macOS 12, use LSSetDefaultRoleHandlerForContentType from LSInfo.h in the LaunchServices framework. No idea how to do this with AppleScript. You could use Automator to make a Folder Action for any file matching a pattern in a particular directory. You'd probably want to put a Set Application for Files action after a Filter Finder Items action.
Topic: App & System Services SubTopic: Core OS Tags:
May ’22
Reply to Some help with software signing and notarization.
https://developer.apple.com/forums/thread/128166 also, read the man pages for codesign and spctl, carefully. Read the log files from your failed notarization attempt - they're telling you what is wrong. Your app isn't signed, you didn't add the timestamp flag, you didn't enable the Hardened Runtime.
Topic: Code Signing SubTopic: General Tags:
May ’22
Reply to Trace/BPT trap: 5 problem in m1 mac
I'm pretty sure the reason this is happening is because you are trying to put the string "helloworld" into x. x has room for 10 chars, "helloworld" requires 11, because strcat wants to put the terminating null into the destination too. You can right-click on strcat and choose Services/Open man page in Terminal from the contextual menu to read about the correct use of strcat.
Topic: UI Frameworks SubTopic: General Tags:
May ’22
Reply to CoreMedia Camera Extension fails to activate
Quinn, thank you for the hint. I was filtering the Console output on my app name, the culprit was fingered by sysextd a few lines further up when I turned off that filter - I didn't prefix my Mach service name with the name of the app group in my entitlement. For future reference, the error 9 is listed in SystemExtension/SystemExtensions.h, and the term to search the SDK for is "OSSystemExtensionErrorDomain"
Topic: App & System Services SubTopic: Core OS Tags:
May ’22
Reply to What is the next step in coding?
I think the next step beyond "learning coding" is learning to apply that knowledge to a particular domain. Code does something, usually something useful to yourself or other people. What useful thing would you like to make possible? What would you like to learn, and how does being able to code help you with that goal?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’22
Reply to Univeral installer for M1/Intel app
why? The easiest thing to do is build a Universal application, at some (usually small cost) to the user in disk space. If you really must do this, you'll need to read up on the documentation for installers: https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW7 and consult the man pages for pkgbuild and/or productbuild. Somewhere in there, you'll probably find that you can restrict what is installed based on arch.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to is XPC from app to CMIOExtension possible?
As we learned in the "Create camera extensions with CoreMedia IO" presentation at WWDC 2022, a Camera Extension can present a sink interface to the system, accessible to an app via the CMIOHardwareObject.h and CMIOHardwareStream.h APIs. The Camera Extension template only offers a source stream, but it is pretty easy to add a sink stream. That's one way to get video into a Camera Extension, it works on 12.3 and it doesn't require a helper daemon to enable the app and extension to find one another. In Ventura, the plan is to have the app's extension be owned by the app's owner, so XPC would be an option. Easier again is to have the extension itself handle the video sourcing, while the accompanying app only provides control and status reporting, using the property interfaces of the extension. That's the intent behind the design.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to is XPC from app to CMIOExtension possible?
I'll type this in the answer box then. If you can require 10.12 or later, it is much simpler than this. As I found out, an IOSurfaceRef cannot be directly transported over NSXPCConnection, but an IOSurface can. No need to do the CreateXPCObject or LookupFromXPCObject stuff unless you're on 10.7 to 10.11. The two types are toll-free bridged. The only thing I'm not sure about is which flavor of __bridge to use at each end. I'm thinking I need write IOSurfaceRef surface = CVPixelBufferGetIOSurface(pixelBuffer); [remoteObjectProxy sendIOSurfaceToExtension:(__bridge_transfer IOSurface *)surface]; and at the receiving end CVPixelBufferRef pixelBuffer; CFPixelbufferCreateWithIOSurface(kCFAllocatorDefault, (__bridge_retained IOSurfaceRef)surface,...); I guess I'll find out...
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Xcode problem on MAC M1 Monterrey
You have a clean (new) install of macOS 12.3.1. It doesn't have python. https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes Search the interweb to find why 'python' doesn't usually resolve automatically to python3, and the various ways you can install multiple versions of python on your machine. I use pyenv.
Replies
Boosts
Views
Activity
May ’22
Reply to Programmatically Change Default Application to Open a File With
from NSWorkspace.h (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenContentTypeOfFileAtURL:(NSURL *)url completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0)); before macOS 12, use LSSetDefaultRoleHandlerForContentType from LSInfo.h in the LaunchServices framework. No idea how to do this with AppleScript. You could use Automator to make a Folder Action for any file matching a pattern in a particular directory. You'd probably want to put a Set Application for Files action after a Filter Finder Items action.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Some help with software signing and notarization.
https://developer.apple.com/forums/thread/128166 also, read the man pages for codesign and spctl, carefully. Read the log files from your failed notarization attempt - they're telling you what is wrong. Your app isn't signed, you didn't add the timestamp flag, you didn't enable the Hardened Runtime.
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Trace/BPT trap: 5 problem in m1 mac
I'm pretty sure the reason this is happening is because you are trying to put the string "helloworld" into x. x has room for 10 chars, "helloworld" requires 11, because strcat wants to put the terminating null into the destination too. You can right-click on strcat and choose Services/Open man page in Terminal from the contextual menu to read about the correct use of strcat.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to CoreMedia Camera Extension fails to activate
Quinn, thank you for the hint. I was filtering the Console output on my app name, the culprit was fingered by sysextd a few lines further up when I turned off that filter - I didn't prefix my Mach service name with the name of the app group in my entitlement. For future reference, the error 9 is listed in SystemExtension/SystemExtensions.h, and the term to search the SDK for is "OSSystemExtensionErrorDomain"
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to What is the next step in coding?
I think the next step beyond "learning coding" is learning to apply that knowledge to a particular domain. Code does something, usually something useful to yourself or other people. What useful thing would you like to make possible? What would you like to learn, and how does being able to code help you with that goal?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’22