私の問題は、次のエントリと非常によく似ています: Mac OS X file association works, but file icon not changed .
Qt 5.3 を使用して、特定の拡張子のファイルを処理するアプリを開発しています (たとえば.xyz
)。私はテスト用にOS X Yosemiteしか持っておらず、ファイルの関連付けを機能させることができました(ファイルをダブルクリックするとアプリケーションが開きます)が、アイコン(xyz.icns
application.appリソースフォルダーにあるもの)は変更されていません(まだデフォルトの白い紙で、デスクトップと Finder から表示できます)。ファイルの関連付けに関連する info.plist の内容は次のとおりです。
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>xyz.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>xyz</string>
</array>
<key>CFBundleTypeName</key>
<string>My App Extension</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array>
私の状況で問題を解決したように見える起動サービスを更新しましたが、実際にはlsregister
ダンプにアプリケーションのエントリが 1 つしか表示されません。
Container mount state: mounted
bundle id: 23036
path: /Applications/My App.app
name: My App
identifier: com.mycompany.my-app (0x8001bf71)
sys version: 10.6
mach sys ver: 10.7
execSDK ver: 10.10
flags: has-display-name relative-icon-path
item flags: container package application extension-hidden native-app x86_64
icons: Contents/Resources/myapp.icns
executable: Contents/MacOS/My App.app
...
--------------------------------------------------------
claim id: 34548
name: My App Extension
rank: Owner
reqCaps:
roles: Editor
flags: relative-icon-path doc-type
icon: Contents/Resources/xyz.icns
bindings: .xyz
私も再起動しましたが、新しい結果はありません。何が欠けているのだろうか...手がかりはありますか?ありがとう !