Lower security setting dialog after changing sandbox settings - xcode

I am developing an app which plays midi files in Mac.
When I activated sandboxing I couldn't hear any midi playback, after googling a bit I found out that I need to add some things in my entitlements.plist file,
So according to one forum which I saw, I added
com.apple.security.temporary-exception.audio-unit-host
I get a dialog box asking me to lower security settings every time I run the app on any mac. This is not desirable, how can i disable it?

The behavior you see is described in TN 2247 by Apple. It looks like you have at least one Audio Component that isn't suitable for sandbox. But probably not the one playing MIDI.
https://developer.apple.com/library/mac/technotes/tn2247/_index.html

Related

Google parental control Family link app doesn't ask for approval

I've setup google parental control on my children phone, they ask for approval to install a game and i approved it, later i changed my mind and uninstall it from there phone, but they went to play store a re-install it, but this time family link didn't ask for my approval, it's just installed it and showed me a notification that it's been installed. What i want is that whenever they install anything, no matter it was once approved or millions times, google play must ask them for my approval each time it's reinstall.
Most probably you approved the app as Always allowed app. To edit app activity:
Open the Family Link app Family Link and then Select your child.
On the "App activity" card, tap Set limits or More.
Next to your desired app, tap Always always allow.
From here you can select an option to:
Always allow always allow.
Set a time limit Set limit.
Set unlimited time Empty hourglass.
Block an app Block.
The Google Family Link app lacks the 'whitelist' feature to allow only a strict set of application to install. Unfortunately, the answer is you cannot prevent the installation of a previously installed application (as a previous answer suggested, you could block said apps).
I experimented and unfortunately disabling and re-enabling Family supervision will still allow previously installed apps to install. Also, the previously installed apps will be available if you get a new device for the child's account. Or at least, this is the functionality circa Fall 2022.
An extreme solution would be to create a new account, but obviously this is a frustrating answer if you are trying to do something like protect an older family member who has established accounts for billing.
This solution outlined below will not work, but I did read it as a proposed solution elsewhere online. I thought I would include it and mention it with this warning.
Open the Play Store app
Select the account icon in the upper right corner
Choose the Manage app & device from the popup menu
Select Manage
Click Installed
Select Not Installed
Select all applications you wish to remove in checkable list
Click the Trash Can icon in the upper right corner
This would disassociate the application from the account in an ideal world; however, it does not and the child account can still reinstall the offending applications. The parent is notified of this installation, but they cannot prevent it.
Had the same issue but rather than doing the "google play delete not installed apps list"-thing which doesnt solve the problem anyway, use this list to search and install the apps you dont want your child to have installed. After that you can manually block these unwanted apps from normal family link app and deinstall them after you've done that. (You can also leave them on the phone, i mean they are blocked anyways, but it should still take memory space so no reason to not deinstall them after)
Now you will see the following if your child tries to reinstall the app from the play store:
picture
it says "your parents blocked this app" (just in german :) )
This "feature" (if you even want to call it that way) is really stupid and this way might be the only one to solve this problem even if a bit time-intensive. Hope Google will work on Family Link. Big potential but soooo many problems.

How can I add files to the iOS simulator in a CI environment?

I would like to include a UI test in my project that exercises its interaction with UIDocumentPickerViewController. The test will need to run on a CI machine, which needs to be able to wipe the simulator before each build, and operate without a human driving the GUI (either on the machine or the simulator).
There are a number of answered questions around how to add files to the iOS simulator, but they seem to all require manual interaction with the simulator UI. What I've tried so far:
Using xcrun simctl openurl file:///path/to/my%20file.pdf, but that just presents a sheet in the files app that would need manual intervention to actually save to the simulator.
Using xcrun simctl addmedia, but the media need to be images or videos and they end up in PHPickerViewController and not UIDocumentPickerViewController.
Using the openurl command above before the test kicks off and then adding a button in my app to open the shareddocuments:// URL to present the Files app, and using the UI test runner to click the "On My Phone" and "Save" buttons. This looks promising but also promises to be flaky.
What I haven't tried yet:
Set up a sockpuppet iCloud account and log the simulator into that account on every test run in order to use iCloud Drive. This seems like yet another credential to manage that will randomly break when it needs to agree to some new terms and conditions.
Replace my test app with a document-based app and figure out how to save a file from the bundle to its file storage without manual interaction. I'd love a guide on how to do this but it feels like I could easily spend a week getting up to speed on document-based apps to get it working.
The code I'm testing is a framework, so the app under test is free to have features that would make no sense to an actual user and is also free to do non-app-store-safe things. But it seems like other developers might appreciate a more general solution if you have one.

Minmizing OpenGL app while preserving EGL Context results in HUGE PROBLEM

I'm using opengl es 3.0 API with the android studio ndk to create apps.
But I've encountered a very huge problem. I've created a demo app, all it does it change the background color of the screen from white to black and vice versa, every frame. And so when I go to minimize this app, I still see it rendering the background, mostly at the edges of the screen, and not in full color but still very strongly apparent. And it doesn't go away when I close the app, when I restart the device, or when I run "kill apps" on it. Only a factory data reset fixes the issue, so it's not easy for me to debug this.
This is the relevant code that I'm using for when the app is minimized and receives the APP_CMD_TERMINATE event:
eglMakeCurrent(engine->display,EGL_NO_SURFACE,EGL_NO_SURFACE,EGL_NO_CONTEXT);
eglDestroySurface(engine->display,engine->surface);
engine->display = EGL_NO_DISPLAY;
engine->surface = EGL_NO_SURFACE;
I've error checked that eglDestroySurface() is successful.
And I've put debugging messages in to make sure that the main draw loop is NOT executing when the app is minimized. But the problem persists and I don't know what to do about it. Thanks for any help.
UPDATE: well, no one has responded, and I still don't know what to do. Could it be related to threads?
UPDATE: Still can't determine what it is, but for some reason it's messing with the System UI. Willing to upload my entire source code somewhere if someone would be willing to go through this with me, as I'd really like to be able to continue working on my game engine.
Is it the "Strict Mode" developer option on the device settings, perhaps?
That one flashes the screen if an app is blocking.
It would explain why a factory reset changes behaviour.
The answer is not a solution here. The above comment by the user columbo was correct.
I've demoed switching from black to white at high framerates on 3 different android devices, and also my Linux Desktop, all via the openGL api, and it has exhibited this issue on all the devices. So what he said must be correct: this is a problem with LCD monitor technology itself. Interestingly, doing completely random colors does not cause this problem.

How can I lock down a Mac to exhibit one website?

I'm currently working on a website that will be in an exhibition soon. Users will have a keyboard and mouse in front of them, so I need to lock down the machine to be restricted to just one website. Guided Access mode on iOS is a perfect example. I wish Apple had an OS X version for this reason.
I'm currently trying parental controls but it seems to be quite buggy/not responding to my preferences. I'd really love to just have Chrome or Safari locked to fullscreen somehow so users can't exit the browser/redirect to another website.
Thank you in advance!
I'm thinking you could put Chrome in kiosk mode(can't change website) then change the shortcut keys for exiting out of fullscreen mode if you can on a Mac, and maybe having another desktop and monitor for emergencies. I would have made this a comment but I can't :P This isn't really an answer, just a suggestion. It would really be easier on another OS to do the stuff above.
Recently used 'Web Kiosk' software for exactly this purpose: https://www.macproline.com/webkiosk
It has a lot of options for locking down the machine, both in terms of web sites visited, and disabling key commands, preferences, switching apps, quitting apps, etc.
When searching for a solution for this, I was surprised how few options there were. That said, I would give this a look.

How do I trigger sound alert in OSX using Cocoa?

When Finder finishes copying of files then it triggers a sound alert. How can I do that from my app?
Please note that it is not the same as simply playing a sound. I am from Windows background so I am assuming that OSX allows users to configure notification sound from some central location. So, if the user chooses a different sound for an event then that API should play that new sound. This way I can make my app gel into the system and it will be able to alert the user using sound which the user is familiar with.
Answering my own question.
Found a good guide on this - System Sounds in Cocoa (wayback machine archive).
Official guide - Introduction to Sound Programming Topics for Cocoa.
Official NSSound reference.
Update
Additional notes
The system alerts are the ones which user can configure, others like emptying recycle bin, sound made when copying files are not.
NSBeep is the simplest way to trigger the alert sound which notifies the user of an error. Other sounds are available at the following locations in Lion.
/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds
For other user interface sounds check the Resources folder under related packages of the core applications. These application packages can be found in /System/Library/CoreServices/.
So, for example if you want to play the move to recycle bin sound then use the following code.
NSSound *systemSound = [[NSSound alloc] initWithContentsOfFile:#"/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/dock/drag to trash.aif" byReference:YES];
if (systemSound) {
[systemSound play];
}
Caveats
The name and path of the sound files may change at anytime. In fact the location of SystemSounds before Lion was /System/Library/Components/CoreAudio.component/Contents/Resources/SystemSounds.
You should also check this guide http://cocoathings.blogspot.com/2013/01/playing-system-sounds.html
NSSound(named: "Funk")?.play()

Resources