macOS is the operating system for Mac.

Posts under macOS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Mistake in OpenGLView:drawRect
I rewrite an old project since OpenGL is deprecated and the downgrade to High Sierra goes with the lost of the old project. Here is the drawRect: - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; if(backgroundColor == 1) glClearColor(0.95f, 1.0, 1.0f, 1.0); else glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef(0.0 ,0.0, -10.0); // After mistake I wrote PushMatrix() glTranslatef(-0.01 ,-0.01, -10.0); // Screen Shot 0 // glTranslatef(-0.25 ,-0.25, -10.0); Screen Shot 1 glLineWidth(1.0); glRotated(rotationX, 1, 0, 0); glRotated(rotationY, 0, 1, 0); glCallList(axes); // After mistake I wrote PopMatrix() // Axes Vertices of xx,y,z are 1.0 // With vertices +/-0.99 nothing is drawn [self glError]; [self.openGLContext flushBuffer]; } I hope you Accept my Text and hope you can help me ! Mit freundlichen Grüßen Uwe Screen Shot 0 Screen Shot 1
1
0
305
Jun ’24
SwiftUI macOS, Multiple DocumentGroups is missing something.
Adding a second "DocumentGroup" to a document based SwiftUI auto converts the "New" menu item into a submenu, with one item "New Document". I'd like to add a second item to that submenu, to create a new instance of my second doc type. Googling around finds one solution, but that doesn't work as I'd expect it to with Ventura 13.6.5 and Xcode 15.2. The solution linked to below, adds a menuitem under the "Open Recent" menu, not in the "New" submenu. https://github.com/Asperi-Demo/4SwiftUI/blob/master/Answers/Handle_different_document_types.md Changing the position to "before", also doesn't add it to the menu, and if you replace ".newItem", you then have to manually handle the Open dialog and the Open Recent menu. So what am I missing?
1
1
306
May ’24
os_signpost not working on macOS device, works on iOS device
I have an iOS app that uses os_signpost API for instrumentation. When I profile it from Xcode on real iOS device, it works as expected. When I profile its macCatalyst variant (using the identical code) on the same Mac where Xcode is running, the os_signpost Instrument does not show anything, not even the Apple provided signposts that are otherwise visible on the iOS. How do I make it work?
5
0
803
May ’24
Skip FileProvider folders without metadata
I want to traverse my local Google Drive folder to calculate the size of all the files on my drive. I'm not interested in files or directories that are not present locally. I use getattrlistbulk for traversing and it takes way too much time. I think it is because FileProvider tries to download metadata for the directories that are not yet materialised. Is there a way to skip non-materialised directories?
2
0
272
May ’24
macOS app crashes on thread 1: com.apple.root.utility-qos
Hi, I'm having an issue with an app written in Swift on Xcode. This app implements an AVKit player for playing HLS audio/video streams, and the player opens as soon as I click the button for the TV channel I want to watch. When I debug the app from Xcode, everything works perfectly and the player opens without any issues. However, when I distribute the app via “Archive,” the initial interface with the buttons is displayed correctly, and the audio-only streams are played (with a reduced player). But as soon as I click on an HLS audio/video stream, the app crashes. Here is the crash log: Crashed Thread: 1 Dispatch queue: com.apple.root.utility-qos Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: TVStreamsApp [42052] [...] Thread 1 Crashed:: Dispatch queue: com.apple.root.utility-qos 0 libsystem_kernel.dylib 0x19f62ea60 __pthread_kill + 8 1 libsystem_pthread.dylib 0x19f666c20 pthread_kill + 288 2 libsystem_c.dylib 0x19f573a30 abort + 180 3 libswiftCore.dylib 0x1af6d99f4 swift::fatalErrorv(unsigned int, char const*, char*) + 128 4 libswiftCore.dylib 0x1af6d9a14 swift::fatalError(unsigned int, char const*, ...) + 32 5 libswiftCore.dylib 0x1af6ed22c getSuperclassMetadata + 816 6 libswiftCore.dylib 0x1af6ed4c4 _swift_initClassMetadataImpl(swift::TargetClassMetadata<swift::InProcess, swift::TargetAnyClassMetadataObjCInterop<swift::InProcess>>*, swift::ClassLayoutFlags, unsigned long, swift::TypeLayout const* const*, unsigned long*, bool) + 84 7 _AVKit_SwiftUI 0x235cabea0 0x235ca7000 + 20128 8 libswiftCore.dylib 0x1af6f9cac swift::MetadataCacheEntryBase<(anonymous namespace)::GenericCacheEntry, void const*>::doInitialization(swift::MetadataWaitQueue::Worker&, swift::MetadataRequest) + 772 9 libswiftCore.dylib 0x1af6e8dc4 _swift_getGenericMetadata(swift::MetadataRequest, void const* const*, swift::TargetTypeContextDescriptor<swift::InProcess> const*) + 2744 10 _AVKit_SwiftUI 0x235cabe14 __swift_instantiateGenericMetadata + 36 Thanks in advance for your help!
0
0
188
May ’24
Why macOS Sonoma doesn't delete /tmp files in app containers?
It looks like macOS Sonoma doesn't delete /tmp files in containers periodically or on reboot, like it does for system /tmp or $TMPDIR. Is it a bug or is it in on purpose? Our app didn't delete its temp files and some users have quite a few of them. We will make the fix so that we clear after ourselves in the future but should we delete temp files manually on start for existing users?
2
0
212
May ’24
'open' command in macOS fails to launch .app file in non GUI environment
I have a bundled application(.app file) in macOS which is a non-interactive application. This app does not link to any GUI frameworks and I am able to launch it using the 'open' command in a normal GUI login session. However, when I perform ssh login to that user and then If I try to launch the application, it fails to launch. I assume that this is happening because my ssh session is a non-GUI session, and 'open' command is due to some reason failing to run in a non-GUI environment, but I m not sure. Can someone help me understand why is this happening?
1
0
180
May ’24
Image resources do not load in Mail application when System Extension is Installed
When our NETransparentProxyProvider system extension is installed on the system it seems that external images from emails do not load on the Mail application. The extension does not have to be running to experience this issue. When we uninstall the extension, these same images load on the Mail application. Another way to get the images to load seems to be to disable "Hide IP address" under Settings > Privacy. We can see this issue present on the latest macOS 14.5. I have filed FB13805670 for this issue. Please advise if this is a known issue or if there is a solution.
1
0
199
May ’24
My macOS TestFlight app keep deactivating its windows as if there's another invisible window in front
Has anyone else seen this happen with their macOS apps in TestFlight? The situation: When I launch my app that's been downloading via TestFlight.app, it often comes up with its main window deactivated. Also, when I have open more than one window and close one, the other window doesn't come to front either. In either case, activating the app or clicking into a window will activate it properly. It feels as if there's another window that's not visible but somehow keeps getting activated. I have this happen on two Macs running both Sonoma and Monterey. Also, if I take the very same build that I had uploaded to TestFlight and run it directly, it works correctly. So I suspect that TestFlight somehow messes with my app's windows. If you want to test this yourself: Get the app thru this link: https://findanyfile.app/TestFlight/ Then launch it. Often, the Find window will already come up without being active. Activate it, then open the Preferences window by typing cmd-comma. Then close the Prefs window with cmd-W. This should re-activate the Find window but will instead leave it deactivated, and none of the menu shortcuts (such as cmd-comma, cmd-N or cmd-Q) work. That's the bug. I wonder how I can debug this to find a work-around for this odd behavior. E.g, I'd like to see if there is indeed a semi-hidden window causing this. How would I do this? I could probably make a new TestFlight build that queries the app's windows array and logs it. But are there other ways to query an app's windows? I tried AppleScript, but since my app isn't scriptable, I only get an error -1728 for tell app "Find Any File" to get windows.
2
0
350
May ’24
Crontab commands are not permitted when sandbox enabled.
For scheduling purpose our Mac application using crontab terminal commands, which are working fine when sandbox is not enabled. For submitting the application to Appstore, we enabled the sandbox option and after that Crontab commands are not working. Getting the error messages as, /bin/sh: /usr/bin/crontab: Operation not permitted. Could you please guide us how to use the crontab commands when sandbox option enabled.
2
0
219
May ’24
macOS rejects certificate with non-ciritical unknown extension
In our macOS daemon process, we are trying to validate a leaf certificate by anchoring intermediate CA cert and evaluating it using SecTrustEvaluateWithError. The leaf certificate contains couple of non-critical MS extensions (1.3.6.1.4.1.311.21.10 and 1.3.6.1.4.1.311.21.7). The macOS API fails to parse these extensions and does not evaluate the cert chain. Below is the error returned: { NSLocalizedDescription = "\U201abc\U201d certificate is not standards compliant"; NSUnderlyingError = "Error Domain=NSOSStatusErrorDomain Code=-67618 \"Certificate 0 \U201abc\U201d has errors: Unable to parse known extension;\" UserInfo={NSLocalizedDescription=Certificate 0 \U201abc\U201d has errors: Unable to parse known extension;}"; } As per RFC2459, a non-critical extension can be ignored by the system: A certificate using system MUST reject the certificate if it encounters a critical extension it does not recognize; however, a non-critical extension may be ignored if it is not recognized. So, why does macOS not ignore these non-critical extension and returns a failure? OS version is 14.4.1.
1
0
307
May ’24
XCFramework codesign verification fails, because macOS temporary files appear inside
At my current company we have an app that has a lot of third party dependencies. Recently vendors started providing code signed XCFrameworks and we would like to use the code signed frameworks without any modification in our released app (don't tamper with the signature, don't remove it, don't resign it). We have a problem, that upon downloading the XCFrameworks from an internal artifact server or upon moving the XCFrameworks on disk during the build process, macOS starts producing temporary files, like .DS_Store, ._* files (for every file X, there is additional ._X file created). Files like this are sometimes called "turdfiles", like here. The files are produced inside of XCFrameworks and inside of the _CodeSignature folder, making codesign --verify --verbose=4 Example.xcframework fail and XCode to complain and fail the build process. I wrote a script that cleans up the _CodeSignature folder from all known turdfiles and then inspects the output of codesign to indentify all surplus files and removes them - this has to be 2 steps, because codesign goes crazy if you tamper with _CodeSignature directory. We run the script in random places of the build system where it seemed to help. Is there any system solution to fix this? Isn't everyone having this problem now, with the introduction of codesigned XCFrameworks? There were tens of people in the company having this issue before we hacked it together using the cleanup script.
0
0
218
May ’24
LAContext not accepting programmatically changed user's password for authentication
I have used functionality of changing user's password programmatically using the OpenDirectory framework. Once the password is updated successfully, can be use this password for Login sessions and authentication wherever required. But the same password is failing authenticate with Local Authentication Framework that is with LAContext and prefers always older password. Even restarting machine won't work. Changing current user's password using below method - do { let node = try ODNode(session: ODSession.default(), type: ODNodeType(kODNodeTypeLocalNodes)) let user = try node.record(withRecordType: kODRecordTypeUsers, name: NSUserName(), attributes: nil) try user.changePassword(currentPassword, toPassword: newPassword) print("Password changed successfully") } catch var error { print(error) } Once password is updated, then trying to authenticate password with LAContext using, let context = LAContext() context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "AuthenticationMessage".localized()) { success, error in DispatchQueue.main.async { completion(success, error) } print("authentication error = (String(describing: error?.localizedDescription))") } It won't accept the updated password. Any idea how to solve this problem?
2
0
217
May ’24
debug dlopen returning NULL
Hi, For the very same plugin dlopen() sometimes fails. The library is present but sometimes it returns NULL and sometimes a valid plugin handle. Here is the code: char *filename; void *plugin_so; filename = "/Applications/com.example.MyApp/Contents/Plugins/myplugin.dylib"; plugin_so = dlopen(filename, RTLD_NOW); I have debugged using lldb checked filename and it is present. The myplugin.dylib file supports 2 architectures, arm64 and x86_64. regards, Joël
1
0
302
May ’24
Block iOS device from being mounted on mac.
Hello. Is there a legal way to block iOS devices from being mounted on macOS? I noticed, that when an iOS device is connected, it pretends to be like a storage device but it is not. It not even going through diskArbitration. It seems that some fileProvider is taking place there. I know that it is possible to do via the MDM profile: <key>PayloadContent</key> <dict> <key>.GlobalPreferences</key> <dict> <key>Forced</key> <array> <dict> <key>mcx_preference_settings</key> <dict> <key>ignore-devices</key> <true/> </dict> </dict> </array> </dict> </dict> But is there some programmatic solution? If I use EndpointSecurity and block file operations for the usbmuxd process on /var folder, it prevents iOS devices from being mounted. But wouldn't be there any negative side effects from such a solution?
1
0
522
May ’24
'iCloud' displayed when File Provider Item is marked as 'Shared'
I am developing a File Provider on Mac. I am marking some items within the domain as 'shared' via the NSFileProviderItemProtocol. However, the text 'Folder shared on iCloud by me' appears in Finder when these items are marked as shared. Is this correct? My provider has nothing to do with iCloud, which is, of course, the cloud developed by Apple. Is there a way to change this text or remove it? I've attached an image that shows the problem.
1
0
312
May ’24
After upgrading the mac to the latest version, simulator(17.4.1) getting crash in every few minutes after launch or hangs and nothing works
Incident Identifier: 8C757080-1227-4FF8-9563-D4AAFE0587BE CrashReporter Key: ACD5C28C-DD36-0D52-56E8-477D2887C6A8 Hardware Model: MacBookAir9,1 Process: Runner [52298] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/E4009C5D-4435-4F7F-BD7E-140632A9CF45/data/Containers/Bundle/Application/88AF44ED-BA26-420D-B011-BA09712D1A56/Runner.app/Runner Identifier: com.test.AppName Version: 1.0.0 (1) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [45746] Coalition: com.apple.CoreSimulator.SimDevice.E4009C5D-4435-4F7F-BD7E-140632A9CF45 [25888] Responsible Process: SimulatorTrampoline [45605] Date/Time: 2024-05-21 18:03:39.1450 +0530 Launch Time: 2024-05-21 17:55:53.3837 +0530 OS Version: macOS 14.5 (23F79) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: Runner [52298] Triggered by Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x7ff8004cd561 __exceptionPreprocess + 226 1 libobjc.A.dylib 0x7ff8000837e8 objc_exception_throw + 48 2 CoreFoundation 0x7ff8004cd44f -[NSException initWithCoder:] + 0 3 Runner 0x1043430ed -[GIDSignIn signInWithOptions:] + 173 (GIDSignIn.m:513) 4 Runner 0x104341ee0 -[GIDSignIn signInWithPresentingViewController:hint:additionalScopes:completion:] + 208 (GIDSignIn.m:264) 5 Runner 0x104ed66e8 -[FLTGoogleSignInPlugin signInWithHint:additionalScopes:completion:] + 184 (FLTGoogleSignInPlugin.m:252) 6 Runner 0x104ed54b5 -[FLTGoogleSignInPlugin signInWithCompletion:] + 901 (FLTGoogleSignInPlugin.m:152) 7 Runner 0x104edaf58 __FSIGoogleSignInApiSetup_block_invoke.175 + 168 (messages.g.m:266) 8 Flutter 0x10e0643df __48-[FlutterBasicMessageChannel setMessageHandler:]_block_invoke + 171 9 Flutter 0x10da1d0e1 invocation function for block in flutter::PlatformMessageHandlerIos::HandlePlatformMessage(std::_fl::unique_ptr<flutter::PlatformMessage, std::_fl::default_deleteflutter::PlatformMessage>) + 94 10 libdispatch.dylib 0x7ff8001783ec _dispatch_call_block_and_release + 12 11 libdispatch.dylib 0x7ff8001796d8 _dispatch_client_callout + 8 12 libdispatch.dylib 0x7ff80018848c _dispatch_main_queue_drain + 1420 13 libdispatch.dylib 0x7ff800187ef2 _dispatch_main_queue_callback_4CF + 31 14 CoreFoundation 0x7ff800429b34 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 15 CoreFoundation 0x7ff80042446f __CFRunLoopRun + 2463 16 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 17 GraphicsServices 0x7ff8103ba08f GSEventRunModal + 137 18 UIKitCore 0x7ff805cdf6ee -[UIApplication _run] + 972 19 UIKitCore 0x7ff805ce416e UIApplicationMain + 123 20 Runner 0x1041cb10f main + 63 (AppDelegate.swift:5) 21 dyld_sim 0x107d023e0 start_sim + 10 22 dyld 0x10d902366 start + 1942 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x107e4914a __pthread_kill + 10 1 libsystem_pthread.dylib 0x107eaaebd pthread_kill + 262 2 libsystem_c.dylib 0x7ff80016dd1c abort + 133 3 libc++abi.dylib 0x7ff8002c6d12 abort_message + 241 4 libc++abi.dylib 0x7ff8002b951a demangling_terminate_handler() + 266 5 libobjc.A.dylib 0x7ff800061fba _objc_terminate() + 96 6 libc++abi.dylib 0x7ff8002c616b std::__terminate(void (*)()) + 6 7 libc++abi.dylib 0x7ff8002c6126 std::terminate() + 54 8 libdispatch.dylib 0x7ff8001796ec _dispatch_client_callout + 28 9 libdispatch.dylib 0x7ff80018848c _dispatch_main_queue_drain + 1420 10 libdispatch.dylib 0x7ff800187ef2 _dispatch_main_queue_callback_4CF + 31 11 CoreFoundation 0x7ff800429b34 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 12 CoreFoundation 0x7ff80042446f __CFRunLoopRun + 2463 13 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 14 GraphicsServices 0x7ff8103ba08f GSEventRunModal + 137 15 UIKitCore 0x7ff805cdf6ee -[UIApplication _run] + 972 16 UIKitCore 0x7ff805ce416e UIApplicationMain + 123 17 Runner 0x1041cb10f main + 63 (AppDelegate.swift:5) 18 dyld_sim 0x107d023e0 start_sim + 10 19 dyld 0x10d902366 start + 1942 Thread 1:: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x107e423ce mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x107e50c88 mach_msg2_internal + 84 2 libsystem_kernel.dylib 0x107e49510 mach_msg_overwrite + 653 3 libsystem_kernel.dylib 0x107e426bd mach_msg + 19 4 CoreFoundation 0x7ff8004298a3 __CFRunLoopServiceMachPort + 143 5 CoreFoundation 0x7ff80042402b __CFRunLoopRun + 1371 6 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 7 Foundation 0x7ff800ea8c9a -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213 8 Foundation 0x7ff800ea8f18 -[NSRunLoop(NSRunLoop) runUntilDate:] + 72 9 UIKitCore 0x7ff805dbc7aa -[UIEventFetcher threadMain] + 518 10 Foundation 0x7ff800ed34d5 NSThread__start + 1024 11 libsystem_pthread.dylib 0x107eab18b _pthread_start + 99 12 libsystem_pthread.dylib 0x107ea6ae3 thread_start + 15 AirPort: Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB31Bus USB Device: T2Bus USB Device: Touch Bar Backlight USB Device: Apple Internal Keyboard / Trackpad USB Device: Headset USB Device: Ambient Light Sensor USB Device: FaceTime HD Camera (Built-in) USB Device: Apple T2 Controller Thunderbolt Bus: MacBook Air, Apple Inc., 86.0
0
0
227
May ’24