I am developing a Mac OS app that accesses information like capturing the computer screen or controlling the mouse. (The app is just for personal use)
This works fine in the beginning. When my app tries to access a feature, I get asked to allow this in the system preferences (See dialog below) and if I do so, I can access the content. And as long as I don't change anything in my code I can rerun the app as often as I want and the permissions stay intact.
My issue is that every time I change something in the code, I also need to grant the permissions again to the app. Can someone please help me and explain why and what I can do to prevent this?
Mac OS: Catalina 10.15.7
Thanks so much for the help!
So even if it seems that you actually have to uncheck and check the box in the privacy settings over and over again, this doesn't mean you have to do it yourself all the time.
What helped me is recording an Automator workflow that checks the boxes for me. You can then run this workflow in a build phase to run it on every build.
Steps:
Open the window for the Security & Privacy settings
Open automator
Create a new workflow
Click the red record button at the top right (You might need to whitelist Automator in the Security & Privacy settings as well)
Record the steps that you normally do to enable the Privacy for your app (uncheck/check the respective box)
End the recording in automator and run the workflow once to ensure it works
Set the Automator workflow playback speed to the max (10x) to speed things up, also set the timeout to 0
Save the automator workflow to the disk
In Xcode click on your Target and switch to the 'Build Phases' tab
Click the '+' > 'New Run Script Phase'
Add the following shell script (Replace the path with the path to your Automator workflow file)
/usr/bin/automator ~/MyFolder/MyWorkflow.workflow
You might need to whitelist Automator in the Security & Privacy settings under 'Accessibility' as well
You will need to leave the Security & Privacy settings window open if you didn't include a step in your workflow to actually open it beforehand.
Now when you build/run the app the Automator script should do the work for you and the Privacy settings should be setup correctly.
Related
We are packaging our app for drag and drop installation DMG as following:
Application Name/Application.app
Application Name/Readme
Application Name/Examples/...
Application Name/Documentation/...
And user is supposed to d&d Application Name Folder to /Applications/.
Everything is code signed including DMG.
From most information I read this should be enough to prevent app translocation happening, but for some reason it isn't for some of our Sierra users?
The solution for them would be beside d&d folder to /Applications is to do another drag & drop (move) Application.app somewhere and back to /Applications/Application Name/ or move only Application Name/Application.app overwriting /Applications/Application Name/Application.app.
Now the question is why do only some users have this issue, and shouldn't code signing dmg prevent app translocation from happening?
I verified they have selected Allow apps downloaded from Mac App Store and identified developers.
I had this same problem on my side and had to go get some help via DTS, so I thought I'd repay the favor by replying here:
To avoid translocation, it turns out that not only is the disk image DMG supposed to be signed, but the file format for the image needs to be very specific: UDRO.
You can see more information about UDRO when you look at the man page for the hdiutil command line tool.
Am facing an unusual problem on blackberry, after i have signed my app with the 3 keys and say "load onto device" via Eclipse Java Plugin for Blackberry - the app loads successfully on the device, but when i click on it to launch it - does not open up, nor even a error or a dialog pops up. Please Help - Cant find a solution for this!
I have often had this issue using the 9800 device. After loading apps to the device it starts "not launching". If you go to options -> application manager -> your app's permissions you might see some permissions as custom. Setting these to "allow" fixes it. After a while it stopped launching even when allowed, deleting the app and letting the device reboot fixes it.
This is my personal experience, I don't know what the official bug/fix is
Implement logging in your application. Log every step on the application startup and write log to a text file, located on device SD Card.
When your application has been installed and you have tried to launch it, check this text file to find out, what is going wrong with your application.
Also there is internal logging mechanism, you may employ it, instead of logging to text file.
From my point of view internal log is more suitable for simple logging purposes. If you want complex logging, then text file located on SDCard is preferred.
Try to start the app, then check the device event log. To open the event log viewer, hold 'Alt' and then press L,G,L,G. You will likely see an error explaining the problem in the event log viewer.
How can I control the logic of say 5 "automatically generated" on/off switches using a method similar to this http://knol.google.com/k/iphone-sdk-application-preferences?pli=1# when the app isn't running. Some of my settings are contingent on other settings being on or off. IE setting logical gates for this plist's pre-generated settings view. I have this working in my App but I can't have my app having invalid settings because of 5 on/off switches that are independent of each other because the app can't currently control them, when I need some of them linked. So basically I just disable this pane, and the user can only change settings in the app. It would be nice to using the "General" Settings app...
Thanks
The only way to do this would be to validate the current App Settings on startup and notify the user if you discover problems with the settings.
Just wondering if it's possible to add a button like the "Clear History", "Clear Cookies" etc buttons in the Safari preferences to your own app's settings bundle? Been digging through the dev docs and can't find any plist specifier for a button, so I'm wondering if this is an internal API for the Apple guys?
After you hit the button, you get an action sheet asking you whether you really want to do it, and then presumably there is some callback based on the user's input.
Also noticed that the Nike + iPod settings have a clear button in them, but again, that app might have access to internal APIs that we don't.
No, this is not possible. The system only supports interacting with the values from within your app. You can't run code from the settings app so a button would be useless.
Nike+iPod is a root application. Anything running under root can run code from basically anywhere (with restrictions, Sandbox is a b**ch) If you're interested you can make a jailbreak preferencebundle with Theos or iOSOpenDev! Which allows you to make a root bundle that can run button action code.
iOSOpenDev, which extends Xcode for iOS jailbreak-style project development, provides project templates that have a check boxes to include either a simple PreferenceLoader (plist-based) or a full PreferenceLoader bundle.
This question already has answers here:
is it possible to open Settings App using openURL?
(4 answers)
Closed 7 years ago.
In an iPhone app I'm working on, the user needs to enter some configuration via the settings application before my app will be able to connect to a server and run. Right now when the user first launches my app, I display an alert explaining that the user should go to settings, enter the config details and then relaunch, but this isn't ideal.
Unfortunately there's no way for me to provide sensible defaults for this app, the server host names, user accounts etc. will vary for each user. I think the best I can hope for is to show an alert explaining that some configuration needs to be entered via settings, and provide a "Take me there..." button that will open settings and then open the section in settings for my app. If that's not possible, opening settings is better than nothing.
I vaguely remember that the iPhone jailbreaking people had figured out a way to launch settings or other apps via a funny URL or phone number in the Addressbook, but I'm not finding any info about it in Google.
:(
As far as I know there's no sanctioned way to open Settings from another app.
In my opinion you should just ask for the values if you need them at launch, storing them in your NSUserDefaults and possibly directing your users to look in Settings.app if they need to change those settings in the future.
Unfortunately that means maintaining some minimal UI for your user to fill in their settings during that first launch, but it seems better from a UX perspective to me than denying the user the joy of using the app immediately.
In its current form, Settings is not really up to the task you want to use it for.
The problem you'll run into, if you haven't already, is that you'll want to verify the user's information somehow. Maybe they entered the server name wrong, or made a mistake in their password. What then? Keep sending the user back to Settings to try again, then switching back to your app to find out if they got it right this time? That's going to be a lousy user experience, and the best way to fix it is to give the user the option of changing the settings in your app so you can verify the information immediately.
Only once you've done that, poof, you don't need to use Settings for this anymore. You can just send users to that account-edit view immediately when your app launches for the first time. Your users get a better experience, and you're saved the trouble of trying to find a good way to get users to find your app's configuration in the Settings app.
Apple does this already-- just look at mobile mail.
One of possible solutions suggested above is to write own settings dialog. I have found this project http://www.inappsettingskit.com/ which you can include to your app and it shows the same settings as iOS does. I did not test it yet, but going to do now.