AppleSimulatorUtils
AppleSimulatorUtils copied to clipboard
Support for Local Network Usage permission
Is your feature request related to a problem? Please describe. iOS 14 introduced a new permission for apps to access the local network. This doesn't seem to be currently handled by the tool.
Describe the solution you'd like It would be nice to add this new permission to the tool.
Describe alternatives you've considered The option does not currently seem to be covered.
Additional context According to the Apple Developer Docs, the new permission is related to the Bonjour service.
I've now figured this out. The configuration is stored in /Library/Preferences/com.apple.networkextension.plist. This file is amended once a new app is installed. For example, the (shortended) entry for the Spotify app is:
<dict>
[...]
<key>DenyMulticast</key>
<true/>
<key>IsIdentifierExternal</key>
<false/>
<key>MatchAccountIdentifiers</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>MatchDomains</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>MulticastPreferenceSet</key>
<false/>
[...]
</dict>
<string>com.spotify.client</string>
MulticastPreferenceSet indicates whether a permission popup has been shown before. DenyMulticast saves the user's choice in response to that permission popup.
The file is manged by the nehelper daemon. We can thus
- unload the daemon with
launchctl unload /System/Library/LaunchDaemons/com.apple.nehelper-embedded.plist
- change
/Library/Preferences/com.apple.networkextension.plistas we wish - reload the daemon with
launchctl load /System/Library/LaunchDaemons/com.apple.nehelper-embedded.plist
There does, however, seem to exist some kind of signature that's additionally added to the file. I haven't figure out yet, how this works. Yet, I've been able to change the file regardless.
For those who want to quickly change the setting with the command line (like me), this is a set of commands that automates granting the setting (for the app com.spotify.client):
plistutil -i com.apple.networkextension.plist -o com.apple.networkextension.xml -f xml
xmlstarlet ed -r "//string[text() = 'com.spotify.client']/preceding-sibling::*[1]/key[text() = 'MulticastPreferenceSet' or text() = 'DenyMulticast']/following-sibling::*[1]" -v true com.apple.networkextension.xml
plistutil -i com.apple.networkextension.xml -o com.apple.networkextension.plist -f bin
Update: Here's a fully working script to grant this permission (needs jailbroken device).