macOS is the operating system for Mac.

macOS Documentation

Posts under macOS tag

1,426 Posts
Sort by:
Post not yet marked as solved
0 Replies
14 Views
I have a .search field in the toolbar of my swiftui macOS app. it only "drops down" to show a couple items if the window is zoomed to full screen. The first screencap is with window zoomed full screen (incorrect behavior). second screencap is window unzoomed (correct). Any advice?
Posted
by Tafkad.
Last updated
.
Post not yet marked as solved
1 Replies
70 Views
Hi there! I am trying to build a macOS app using Electron. There is a feature on the app that depends on a http server to run locally. This Server was built using Java. Both the compiled server and the Java Runtime Environment were bundled in the build. To start the server I use NodeJS's child_process.spawn, pointing the bundled JRE's executable and the server implementation. The issue I am facing is that the Java Virtual Machine is not starting. It returns the following error message: Error: Port Library failed to initialize: -1 Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Both the JRE and the server are located in Contents directory, in a subdirectory I have created for them. Here are the app's entitlements: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.application-groups</key> <string>REDACTED</string> <key>com.apple.application-identifier</key> <string>REDACTED</string> <key>com.apple.developer.team-identifier</key> <string>REDACTED</string> <key>com.apple.security.cs.allow-jit</key> <true/> <key>com.apple.security.cs.allow-unsigned-executable-memory</key> <true/> <key>com.apple.security.cs.allow-dyld-environment-variables</key> <true/> <key>com.apple.security.cs.disable-executable-page-protection</key> <true/> <key>com.apple.security.cs.disable-library-validation</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.network.server</key> <true/> <key>com.apple.security.device.microphone</key> <true/> <key>com.apple.security.device.audio-input</key> <true/> <key>com.apple.security.device.camera</key> <true/> <key>com.apple.security.print</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key> <true/> </dict> </plist> Here the entitlements inherit: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.inherit</key> <true/> </dict> </plist> Is there any missing step to allow the spawning of this process?
Posted Last updated
.
Post not yet marked as solved
2 Replies
54 Views
I made a simple app in Swift. Compilation was on MacBook Pro 16 (Apple M3 Pro) / Sonoma 14.4.1, and the XCode version used was 15.3. When I run this app on Big Sur(11.5.2) / Intel Core i5 iMac, following message is noticed. "The 'MYAPP' application cannot be opened because this application is not supported on this Mac." If I run MyApp.app/Contents/MacOS/myapp directly, “...Bad CPU type in executable”is displayed. Build Settings are as follows: Minimum Deployments: macOS 11.0 Architectures: Standard Architectures (Apple Silicon, Intel) - $(ARCHS_STANDARD) Build Active Architecture Only : Debug - Yes / Release - No Code Signing by : Development ID and notarization is completed Additionally, SimpleFirewall (The Network Extension example) works well on Big Sur. I compared all settings with The SimpleFirewall project and couldn't find anything unusual.
Posted
by SaferZone.
Last updated
.
Post marked as solved
4 Replies
476 Views
I tried to read an Object : -(NSMutableDictionary*) readMyObject:(NSData*)data; { NSError * error; Class class = [NSMutableDictionary class]; NSMutableDictionary * dict; dict = [NSKeyedUnarchiver unarchivedObjectOfClass:class fromData:data error:&amp;error]; return dict; the result was nil. I searched by Developer for a solution and found one : { // NSKeyedUnarchiver * unarchiver = [[NSKeyedUnarchiver alloc] init]; [unarchiver decodeObjectOfClasses: [[NSSet alloc]initWithArray: @[[NSDictionary class], [NSMutableDictionary class], [NSArray class], [NSMutableArray class], [NSString class], [NSNumber class]]] forKey:NSKeyedArchiveRootObjectKey]; [unarchiver finishDecoding]; } The first line was from me and it crashed the project. I assume there is an easy answer, not for me.🥲 Uwe
Posted Last updated
.
Post not yet marked as solved
4 Replies
203 Views
When you use the eslogger command line tool to dump 'profile add' and 'profile remove' notify events, the instigator process seems to always be reported to be the mdmclient process whatever the "real" instigator is: the Profiles pane in System Settings.app. a MDM solution the profiles command line tool. [Q] Is this expected? Because for another family of notify events where there is also an instigator field, the instigator points to the "real" instigator.
Posted Last updated
.
Post not yet marked as solved
0 Replies
28 Views
Hi everyone , I would like to ask about system setting, does any setting can make the Mac wakeup faster when it display off after logout.? it look like it will take around 20s to show the login screen after key press. I want it be faster. do any setting for this behavior ? Thanks for all.
Posted Last updated
.
Post not yet marked as solved
1 Replies
579 Views
So I'm building a colour sampler tool, similar to ColorSlurp and since CGWindowListCreateImage (which I am using for below macOS 14.0) is deprecated since Sonoma, I am wondering what's the best approach to replacing it. The way I use CGWindowListCreateImage currently is to take a screenshot of a specified area around the mouse pointer every time the mouse moves. Which works perfectly fine without issues. Now I've tried replacing CGWindowListCreateImage with SCScreenshotManager.createImage which is an async function and as you might expect, running async functions on mouse movements doesn't quite work out that well. It is lagging behind, heavily. So my question would be what's the appropriate ScreenCaptureKit methods to replace the functionality already created with CGWindowListCreateImage? Should I create a SCStream instead? Then I am worried about the fact that I would need to stream the whole screen instead of just the area around the mouse pointer since updating stream configs is an async function as well. I'd greatly appreciate any sort of direction!
Posted
by shipty.
Last updated
.
Post not yet marked as solved
0 Replies
82 Views
Hi All, Finder is caching the old application name and not showing the new application. I am deploying my iPad app to M1 Mac by generating a package file. In the newer version of this application, I have changed my application name and deployed the application from backend to user machines. Eventhough application is deployed successfully, the application name still remains the old. I went through the forum and tried the reset the finder cache and launcher service caches, but still the new application name is not coming. But when I uninstall and reinstall the application it is showing the new application name. Can someone suggest a way to reset this using script, as we are deploying the application from backend, we dont have direct access to the client machines Thanks Ranga
Posted Last updated
.
Post not yet marked as solved
0 Replies
71 Views
Dear all, I want to delete mail app and outlook for mac app saved password (exchange on-promised server) in keychain (macOS big sur 11.7.10). I can delete outlook for mac app's password by command: security delete-generic-password -l "Exchange" But I cannot delete mail app's password by command: security delete-generic-password -l "com.apple.account.Exchange.password" Please provide the right command. Thanks in advanced.
Posted Last updated
.
Post marked as solved
3 Replies
1.4k Views
The MAC device is a device that has been manually added to the Apple Business Manager. DEP profiles are normally installed in both iOS and iPadOS. Profile descript error occurs only when attempting DEP of MacOS. (If you look at the picture, a decryption error occurs in the remote device registration step.) I asked Apple's customer center about this problem,  and it is said that it is caused by the lack of a key called "automatic registration on the MDM server" The key cannot be found in the Apple official document related to the profile below. https://developer.apple.com/documentation/devicemanagement/mdm/ Information received during DEP enroll of Macmini using Apple silicon. {    'LANGUAGE': 'en_US',    'PRODUCT': 'Macmini 9,1',    'SERIAL': 'CXXXXXXXXXXV',    'UDID': '0XXXXX27-XXXX-XXXX-XXXX-XZXXXXXXXXX',    'VERSION': '21C52' } Information received during DEP enroll of iPAD {    'LANGUAGE': 'en_US',    'PRODUCT': 'iPad5,4',    'SERIAL': 'DXXXXXXXXXXQ',    'UDID': '9aXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6d',    'VERSION': '19C63' } Profile to be transmitted to the device (same as MacOS, iOS, IPadOS) {    'AccessRights': 8191,    'CheckInURL': 'https://apm.xxxxx.com/checkin',    'CheckOutWhenRemoved': True,    'IdentityCertificateUUID': '00000000-0000-0000-0000-000000000000',    'PayloadDescription': 'MDM Profile',    'PayloadDisplayName': 'MDM',    'PayloadIdentifier': 'com.xxxxx.xxxxxxx.mdm',    'PayloadOrganization': 'MDM provider',    'PayloadType': 'com.apple.mdm',    'PayloadUUID': '00000000-0000-0000-0000-000000000000',    'PayloadVersion': 1,    'PromptUserToAllowBootstrapTokenForAuthentication': True,   'ServerCapabilities': ['com.apple.mdm.per-user-connections','com.apple.mdm.bootstraptoken'],    'ServerURL': 'https://apm.xxxxx.com/server',    'SignMessage': False,    'Topic': 'com.apple.mgmt.External.206bfa63-f76a-4381-9e50-6f74241d14d9' }  Because it uses the same profile structure, it is not understood that iOS/iPadOS operates normally and errors occur only in MacOS. If there is anything that can help me, please let me know. Thank you.
Posted
by DaveKoh.
Last updated
.
Post not yet marked as solved
0 Replies
84 Views
Hi, I'm looking at being able to set a display colour profile via terminal. I know apps such as SwitchResX are able to change this but i can't figure out how and if it is possible to switch via a terminal command or via a script. This here is what i would like to change. I have googled about and searched through preference files but can't find anything. Any help is much apreciated. Thanks, James
Posted
by JamieS56.
Last updated
.
Post marked as solved
3 Replies
148 Views
I wanted to identify the shutdown event in macOS, so that If my application is running and the user performs a system shutdown then my application could be notified of the shutdown event and perform finalization. I came across NSWorkspaceWillPowerOffNotification which is exactly what I require, however, I created a sample application to observe for this notification. Is is observed that right before the system shuts down, the OS terminates my application invoking applicationWillTerminate(_:) delegate and the observer method for 'NSWorkspaceWillPowerOffNotification' is not invoked. I could perform my finalization in the applicationWillTerminate, but I wanted to know why is the observer not getting invoked. Also why is NSWorkspaceWillPowerOffNotification, even provided by apple when it invoked the termination delegate before shutdown? below is how I m adding the observer: NotificationCenter.default.addObserver(forName: NSWorkspace.willPowerOffNotification, object: nil, queue: nil, using: AppDelegate.handlePowerOffNotification) Below is my observer function, which just logs: public static func handlePowerOffNotification(_ notification: Notification) { NSLog (AppDelegate.TAG + "System will power off soon! Perform any necessary cleanup tasks.") // custom logger to log to a file TWLog.Log ("System will power off soon! Perform any necessary cleanup tasks.") }
Posted Last updated
.
Post not yet marked as solved
0 Replies
115 Views
I have a bundled application that contains a widget extension. On launching the application once the widget appears in the widget gallery, However, I have observed that If my widget extension is not sandboxed, the widget fails to show in the widget gallery. Is this expected? I am using the same xcode project and just that AppSandbox capability for the widget extension target is causing this. Can someone please explain why is this happening?
Posted Last updated
.
Post not yet marked as solved
0 Replies
87 Views
I have a swiftui iPhone app running on the "iOS Apps on Mac" simulator. What I'm trying to do is get a notification when the window size changes, but nothing seems to work. I have tried .onReceive(NotificationCenter.default.publisher(for: UIContentSizeCategory.didChangeNotification)) { _ in updateStuff() } I also tried .onAppear() { updateStuff() } but neither seems to get called any suggestions ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
110 Views
Hello, I have an iOS app that is recording audio that is working fine on iPads/iPhones. It asks for microphone permission and after that recording works. I installed the same app on my M3 MacBook via TestFlight since iPad apps are supposed to work without a change that way. The app starts fine and everything, but it never asks for Microphone permission, so I can't record. Do I need to do something to make this happen (this is not macCatalyst, its running the arm64 iPhone binary on macOS) thanks
Posted
by uuuuuu.
Last updated
.
Post marked as solved
6 Replies
2.6k Views
Hi there, I have two extension in my App, a Finder Sync and a Share Extension. Because these are disabled by default and automatically enabling them is, according to my extensive research, not possible, I want to provide an easy way for the user to enable the extensions when the app is opened. I am currently displaying a popup, with a button to open the preferences. I have struggled with this a bit, by now I managed to open the main preferences window using NSWorkspace.shared.open(URL(string: "x-apple.systempreferences:com.apple.preference")!) which is rather suboptimal though, since the user has to select the extensions option manually and isn't directly redirected there. What I have also found is that the menu of the FinderSyncExtension can be opened directly by using FIFinderSyncController.showExtensionManagementInterface() which is unfortunately suboptimal as well, because it only shows the managment interface of the finder extension and not the overview of all extensions. Is there any way to either enable the extensions programatically, or if not, is there a way to show the "Added Extensions" portion of the Extensions menu in the system preferences?
Posted
by Elia314.
Last updated
.
Post not yet marked as solved
10 Replies
3.0k Views
I'm new to Xcode cloud - working with a Mac OS app, build is working great. Now I am trying to add a Test action; the testing target builds but won't run, and the error indicates it can't find the testing bundle in the expected build output. There's also mention of a code signing error, but I have automatic code signing enabled with the same settings on test target as the app. I am only running the unit test (XCTest) scheme, not the UI tests. When I run it locally from the IDE it works fine, either selecting the test scheme explicitly or as the test step of the app scheme. I notice the XCTest target's scheme setup uses Debug builds and expects the test output to be in the Debug .app bundle, I thought perhaps that was the problem (in case only the release app bundle actually gets built in the Xcode Cloud environment). So I created a duplicate scheme and set the build targets to Release - again I can run this fine locally (after creating a release build), but it fails with the same error in Xcode cloud. I also tried changing the code signing certificate from "Development" to "Sign to run locally" to see if that made a difference, but I get the same error. (It's using my developer account Team, and "Automatically manage signing".) Can anyone relate the proper way to set up an XCTest scheme so that the tests will actually run in a Mac OS Xcode Cloud workflow? I'm using Xcode 14.0.1. Here's the full error output, with [AppName] and [TestTargetName] substituted for the actual: [AppName] (....) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult. (Underlying Error: The bundle “[TestTargetName]” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle. dlopen(/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName], 0x0109): tried: '/Volumes/workspace/TestProducts/Debug/[TestTargetName]' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/[TestTargetName]' (no such file), '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' (code signature in <....> '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)))) Thanks!
Posted
by ccorbell.
Last updated
.
Post marked as solved
4 Replies
527 Views
I have an app group to share settings between a main app and a helper. This is accessed using [[NSUserDefaults alloc] initWithSuiteName: @"FDHC2KMZ6V.com.jwwalker.autopairs.suite"]. What's puzzling me is that if I go to Terminal and enter defaults read FDHC2KMZ6V.com.jwwalker.autopairs.suite it tells me that the domain does not exist. Is this a bug in the defaults tool, or is there some trick I'm missing?
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
0 Replies
137 Views
Apple Transporter.app report this issue: Asset validation failed (90237) The product archive package's signature is invalid. Ensure that it is signed with your "3rd Party Mac Developer Installer" certificate. In the post "https://developer.apple.com/forums/thread/680438" Quinn “The Eskimo!” reply: For the Mac App Store you need: Apple Development: TTT (or the older Mac Developer: TTT) for day-to-day development 3rd Party Mac Developer Installer: TTT for signing the installer package you submit to App Store Connect 3rd Party Mac Developer Application: TTT for signing the code inside that installer package In https://stackoverflow.com/questions/29039462/which-certificate-should-i-use-to-sign-my-mac-os-x-application" Apple Codesigning Certificate Types Mac App Distribution 3rd Party Mac Developer Application: Team Name Used to sign a Mac app before submitting it to the Mac App Store. Mac Installer Distribution 3rd Party Mac Developer Installer: Team Name Used to sign and submit a Mac Installer Package, containing your signed app, to the Mac App Store. Both Mac App Distribution and Mac App Distribution was added to Keychain Access: Picture 1: Xcode -> Preferences -> Account -> Manage Certificates show that "Mac Installer Distribution" is there: Picture 2: And "Mac Installer Distribution" is also shown in my "Account" -> Certificates, IDs & Profiles -> Certificates in developer.apple.com Picture 3: Is "3rd Party Mac Developer Installer" = "Mac Installer Distribution" missing somewhere ? What can I do to fix "Asset validation failed (90237)" in Apple Transporter.app ?
Posted
by Alain_B.
Last updated
.