My question is similar to this article , but with a slight difference: it occurred on an SwiftUI Document-based App (DocumentGroup).
Here is my plist:
<?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>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>abc</string>
</array>
<key>CFBundleTypeName</key>
<string>ABC File</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.xxxx.abc</string>
</array>
</dict>
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>com.apple.package</string>
</array>
<key>UTTypeDescription</key>
<string>Scale Data</string>
<key>UTTypeIconFiles</key>
<array>
<string>appicon</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.xxxx.abc</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>abc</string>
</array>
</dict>
</dict>
...
...
After setting up the icon (the image file, named ‘appicon.png’, is located in a project folder rather than in Assets.xcassets, and only ‘appicon’ is required in plist), the following issues were encountered::
-
The simulator’s document file shows the icon, but the physical device does not display any icons.
-
Deleting Xcode’s Developer Cache, Derived Data, Build, and restarting the Mac —
Ineffective
-
When the physical device installs a new version of the app for the first time, and there are no older versions of the app on the device, the icon appears successfully —
Effective
-
Deleting the old version of the app on the physical device, restarting, and reinstalling the new version of the app —
Ineffective
-
On the iPhone, long-pressing the document file of the physical device and selecting ‘get info’ —
Effective
-
Using the above method on the iPad version —
Ineffective
-
It was found on StackOverFlow that Mac has a similar issue, which can be resolved by clearing the cache via Command Line to update the icon
-
However, since iPads do not have Command Line, the next idea was to Reset All Settings for the iPad + reinstall the new version of the app —
Effective
Hope the information and steps provided above can help everyone.
Jason Wang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.