Post

Replies

Boosts

Views

Activity

Measuring Mac Metal FPS
When running a macOS app rendering with Metal under the Xcode 12 debugger, the debug navigator displays FPS (frame rate) among other things. But if I launch the program outside Xcode and attach to the process, the debug navigator does not show FPS, though it does show memory usage and such. What's up with that? I tried changing the Run mode of the scheme to use the Release build instead of the the Debug build, but then rendering was quite noticeably slower. Is there some quick way to get a frame rate? I'm aware that Instruments can measure various things relating to Metal, but it's not obvious to me how to see something as simple as a frame rate.
0
0
1k
Mar ’21
Xcode build rule input files
As I understand it, when you define a custom build rule with a script, Xcode will pass each matching input file to your script though variables like INPUT_FILE_PATH. So you normally don't need to explicitly list input files. However, there is an "input files" section in the build rule definition. How is that used? I'm hoping that it only used for dependencies and deciding whether a rule needs to be run. For example, suppose my rule is compiling a source file. Normally I just want to re-run the compile if the source file changes, but if the compiler itself changes, I probably also want to recompile. Can I list the compiler as an input file?
0
0
1k
Jun ’21
Why would event tap creation fail?
On my Mac (running Ventura), so long as my app is granted accessibility permission in System Settings > Privacy & Security > Accessibility, I am able to create a global event tap like so: CFMachPortRef thePort = CGEventTapCreate( kCGAnnotatedSessionEventTap, kCGTailAppendEventTap, kCGEventTapOptionDefault, // active filter CGEventMaskBit(kCGEventKeyDown), CTapListener::MyTapCallback, NULL ); But on a user's computer, also running Ventura, the CGEventTapCreate call is apparently returning NULL, even though he's showing me a screen shot of the accessibility permission being turned on. Any ideas what I could be missing, or how to debug it?
0
0
1.1k
Jan ’23
generic Xcode archive for plugin
I'm building a plug-in for an app that I did not create, and I would like to notarize it. I know I can so that using notarytool, but it would be nice if I could do it using Xcode. However, when I archive, it creates a "generic Xcode archive". I've read TN3110: Resolving generic Xcode archive issue. Since the plugin is being created by itself rather than as part of a larger build product, I assume that I should use the SKIP_INSTALL = NO build setting. I am less sure of what to do with the INSTALL_PATH build setting. If I leave it empty, then nothing gets created in the Products folder of the archive. If I set it to some path, then the product is placed in the archive but nested in a subfolder of Products.
0
0
647
Jul ’23
Is there still a need for sending kAESync Apple Event to Finder?
I'm updating some very old code, and it sends an kAESync Apple Event to the Finder to let Finder know that a file has been created or updated. Does this still serve a purpose? I know that Apple Events still exist, but creating the event involves deprecated things like FSRef and AliasHandle. Possibly related: -[NSWorkspace noteFileSystemChanged:]. The documentation says that it informs the workspace object, so maybe it doesn't inform the Finder, and the documentation also says "Avoid calling this method if possible".
0
0
476
Sep ’23
How to simulate mouse events in my own app
I want to be able to simulate mouse clicks, moves, and drags within my own app. I can do that using CGEventPost, but that requires accessibility permission, which seems silly to require when I'm not trying to control another app. An alternative is to create mouse NSEvents and use -[NSApplication postEvent:atStart:]. By that approach, I am able to click a button and watch it highlight and unhighlight, but the mouse cursor never moves and the pressedMouseButtons class property of NSEvent never changes. Is there a better way to simulate mouse events without requiring accessibility permission?
0
0
763
Jan ’24
ENABLE_ENHANCED_SECURITY module file not found
When I tried turning on ENABLE_ENHANCED_SECURITY = YES in an Xcode 26.1 beta project, I got a bunch of "module file not found" errors like this: While building module 'CoreServices': In file included from <module-includes>:1: /Applications/Xcode26.1-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:2: fatal error: module file '/Volumes/Work/Xcode-derived/PlainCalc3-gixjfymjqamwmufdwcseugzjehqa/Build/Intermediates.noindex/ExplicitPrecompiledModules/CoreFoundation-5POB3HW0BHFSPWLD7DOOKAULM.pcm' not found: module file not found 19 | #include <CoreFoundation/CoreFoundation.h> | ^ I tried deleting the project's derived data. Is this a known issue?
0
0
68
Sep ’25