Posts

Post not yet marked as solved
1 Replies
793 Views
I am seeing a weird behaviour when i copied my app to application folder without code signing and notarizing then i am seeing multiple User consents related to file access, but when i codesign and notarize and then copy it to my applications folder and use , i am not seeing user consents related to Files and Folders access. How is this related ?
Posted Last updated
.
Post not yet marked as solved
5 Replies
1.8k Views
In Catalina I have added "Privacy - Document Folder Usage Description" : "Catalina wants to access your Destkop folder" in Info.plistCode trying to access Desktop folder :do { try FileManager.default.trashItem(at: NSURL(fileURLWithPath: "/Users/catalina/Desktop/Doc.docx") as URL, resultingItemURL: nil) } catch let err as NSError { print(err) }I see system generated user consent but my customised message is not being added
Posted Last updated
.
Post not yet marked as solved
1 Replies
542 Views
I am using below code to trash an item do { try FileManager.default.trashItem(at: NSURL(fileURLWithPath: "/Users/syamalacat/Downloads/Doc.docx") as URL, resultingItemURL: nil) } catch { print(error) } I dont see Downloads under xcode application to check the box in Files and Folders in System Preferences pane, but it is just throwing below errorError Domain=NSCocoaErrorDomain Code=513 "“Doc” couldn’t be moved to the trash because you don’t have permission to access it." UserInfo={NSURL=file:///Users/syamalacat/Downloads/Doc.docx, NSUserStringVariant=( Trash), NSUnderlyingError=0x600000c6fed0 {Error Domain=NSOSStatusErrorDomain Code=-5000 "afpAccessDenied: Insufficient access privileges for operation "}}From Files and Folders , i am not able to add Downloads folder, it is greyed out Even for the first time i am not able to see user consent message Note: I am running my application from xcode itself
Posted Last updated
.
Post not yet marked as solved
14 Replies
2.6k Views
I am trying to stop a nodejs server started using forever using below code: func shell(command: String) -> Int32 { let task = Process() task.launchPath = "/usr/bin/env" task.arguments = ["sh", "-c", command] task.launch() task.waitUntilExit() return task.terminationStatus }shell(command: "$forever_PATH/forever stop node.js")I am seeing below error env: node: No such file or directoryPS:node is located in /usr/local/bin
Posted Last updated
.
Post not yet marked as solved
1 Replies
438 Views
In my application i am trying to copy a file to ~$HOME/Library/Group Containers/UBF8T346G9.Office which is accessible without giving Full disc access to my app In the same application i am trying to copy a file to /private/var/folders/g0/hjdk9k4j3055p65mhnzyz04r0000gp/T/TemporaryItems , which throws me error operation not permitted and my application is added under Full disk access pane where i have to go and manually add. How to check which locations are not permitted to access. Any reference to understand how full disk access works.Any help is much appreciated
Posted Last updated
.
Post not yet marked as solved
2 Replies
1k Views
With new security and permission related checks including in Mojave and Catalina. In my swift application I am trying to create a copy of file using below function“open func copyItem(at srcURL: URL, to dstURL: URL) throws”As I call this function , my application entry is created under Full Disk Access panel of Security & Privacy in System Preferences. Unless until I enable this I can’t create a copy of my file using the function I mentioned above.My issue: This entry getting added to the Full Disk Access is happening silently, I dont see any security alert asking me to allow or dont allow. We dont even have any API to get this information , so that we can ask user to manually add it.Where can I get appropriate documentation about Full Disk access feature which will help to understand which locations are restricted to access and how can I enable it programtically without users interference
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.6k Views
Applications which require Full Disk Access in macOS 10.14 Mojave must instruct their users to navigate into System Preferences > Security & Privacy > Full Disk Access and add the application to the whitelist. This procedure is complicated and will frustrate new users of such an app.There should be a API for this – an asynchronous function which, when called by an app, would present the user with a dialog requesting Full Disk Access and, if the user clicks OK, automatically enter the calling app into the Full Disk Access whitelist. This function should pass the user's YES or NO to its completion handler. There should be another function which would indicate an app's Full Disk Access status.It appears that Apple has added API to check for AppleEvent authorization. Did they added something similar for Full disk access, if yes please redirect me to that API
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
At present i am removing my application from recent apps by modifying com.apple.dock.plist. Is there any swift API that helps me to remove it from recent-apps. Because after uninstalling my app this remains in my docbar as questionmark(?). I want to have a clean uninstalltion that is my goal
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.4k Views
I am exposing an Mac OSX application by adding its bundle identifier and urlscheme in com.apple.launchservices.secure.plist. <?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>LSHandlerPreferredVersions</key> <dict> <key>LSHandlerRoleAll</key> <string>-</string> </dict> <key>LSHandlerRoleAll</key> <string>com.test.myurl</string> <key>LSHandlerURLScheme</key> <string>myurl</string> </dict> </plist>Until I restart the machine I don't see the url scheme in lsregister - dump output /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep myurl canonical id: com.test.myurl (0x80000008) URL scheme: myurl all roles: com.test.myurl (0x80000008)Even immediately after deleting these entries from the plist is also not reflecting in lsregister , I need to restart.I tried Kill, seed of lsregister but no luck. How to update this entries in lsregister without a restart
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
My plist has below keys <key>StandardOutPath</key> <string>$HOME/launchd.stdout.log</string> <key>StandardErrorPath</key> <string>SHOME/launchd.stderr.log</string>But it doesnt identify $HOME, i want to load this plist in different user accounts, i cant hardcode my user name
Posted Last updated
.
Post not yet marked as solved
1 Replies
2k Views
command and its output launchctl list | grep Terminal 94502 0 com.apple.Terminal.2000What is the 2000 number referring to?94502 is Pid and0 is exit statusWhat does it mean if pid is empty _. _ 0 com.apple.Terminal.2000What is the difference between this and LaunchAgent/LaunchDaemonservices
Posted Last updated
.
Post not yet marked as solved
1 Replies
851 Views
My purpose is to launch my application during every login but is being launched multiple times.I copied my below plist file in to /Library/LaunchAgents and game root ownership and chmod 600 <?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>Label</key> <string>en com.test.UserAgent</string> <key>ProgramArguments</key> <array> <string>/Applications/Test/Test Agent.app/Contents/MacOS/Test Agent</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>When I login it loads and I can see it in launchctl list as 825 0 com.test.UserAgent 825 ==> Pid of my running applicationWhen I quit my agent manually I see _ 0 com.test.UserAgent - ==> Which means application is currently not runningThen I relaunched my application manuallyI see this in launchctl list 7075 0 com.test.workagent.30264 7075 ==> Pid of my application runningAfter some time my launchd is also trying to load launch agent service I see another instance of my application is being run. 8124 0 com.test.UserAgent ==> LaunchAgent Service 7075 0 com.test.workagent.30264. ==> Manually launched from applicationsExpected behaviour is launch agent service should not launch my application again other than during login time
Posted Last updated
.
Post not yet marked as solved
1 Replies
621 Views
In mac osx when user logouts from it, I want to do certain action to make it graceful. I added my code in func applicationWillTerminate(_ aNotification: Notification) { // do some housekeeping }But my code is not completely executing, I want to block logout until my operation is complete.
Posted Last updated
.