I am trying to change keyboards layout programmatically. I found solution here change input source language programmatically OSx, but it is not working in sandboxed application. I found out I need to set an exception in entitlements file, more precisely com.apple.security.temporary-exception.mach-lookup.global-name
<?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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>com.apple.tsm.portname</string>
</array>
</dict>
</plist>
When I run an application I still get an error 16.03.15 17:47:48,000 kernel[0]: Sandbox: my_app(3704) deny mach-lookup com.apple.tsm.portname
in console. Here is documentation for changing keyboard layout, but nothing about sandbox. https://developer.apple.com/library/mac/documentation/TextFonts/Reference/TextInputSourcesReference/index.html#//apple_ref/c/func/TISSelectInputSource
Any ideas?