How add Export/Import Universal Type Identifier Icon to Xcode 12 Project?

Viewed 987

I'm using Xcode 12 and I'm trying to adding Universal Type Identifier icon for export and import process.

So I have tried below ways for creating the icon.

  1. added .png file to shared folder.
  2. created .icns file using .png file via online tool and added it to project.
  3. create .icns file using terminal command iconutil -c icns icns.iconset

But when i click plus button of the first screenshot,

enter image description here

it suggests three files in dialog like second screenshot.

enter image description here

if i choose one of them, it will not come to GUI and changes are not applied to project. Please, help me to resolve this issue , i really appreciate your feedback.

1 Answers

It seems a bug of Xcode 12, but we can edit Info.plist manually. If your icon file name is appicon.png try to edit the plist like below.

    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeIconFiles</key>
            <array>
                <string>appicon</string>
            </array>
        </dict>
    </array>
    <key>UTImportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeIconFiles</key>
            <array>
                <string>appicon</string>
            </array>
        </dict>
    </array>
Related