Post

Replies

Boosts

Views

Activity

Reply to Authorization by AEDeterminePermissionToAutomateTarget waits infinit time
I find a simple way to reproduce this issue with 100%, and I've reported FB9126429. Please follow these steps: Open Apple Music. After that, press CMD+W, make sure there’s no window for Apple Music is opened. Click Apple Logo and choose “Log out”, make sure the “Reopen windows” is checked. After login again, you will see Apple Music is appearing the Dock, and no window is open. That’s correct. If you open Activity Monitor, you will see Apple Music with 8KB memory Do not try to click Apple Music Icon on Dock, now open the project of TestAEDeterminePermissionToAutomateTarget, build and run. Click the “Grant Permission” button. You will see the App stuck at the method of AEDeterminePermissionToAutomateTarget, with semaphore_wait_trap method call. If you click the Apple Music Icon on Dock, Apple Music will launch normally, then build and run the again, everything will work fine. I hope these steps will be helpful so that this bug will be fixed soon. Thanks. Since I can't upload the Xcode project, here's the core code, you can build your own demo in seconds. let bundleIdentifier = "com.apple.Music" let targetAppEventDescriptor = NSAppleEventDescriptor(bundleIdentifier: bundleIdentifier) let status = AEDeterminePermissionToAutomateTarget(targetAppEventDescriptor.aeDesc, typeWildCard, typeWildCard, true) debugPrint(status)
Jun ’21