|
| 1 | +--- |
| 2 | +id: app-icon |
| 3 | +title: App icon |
| 4 | +sidebar_label: App icon |
| 5 | +--- |
| 6 | + |
| 7 | +Every app should have an impactul icon that stands out from all the others apps available on the user's device. |
| 8 | + |
| 9 | +An app icon is a graphic that represents your app to users. It can: |
| 10 | + |
| 11 | +- Appear in the list of apps installed on a device and on the Home screen. |
| 12 | +- Represent shortcuts into your app (for example, a contact shortcut icon that opens detail information for a contact). |
| 13 | +- Help users find your app on Google Play and App Store. |
| 14 | + |
| 15 | +> ℹ️ An app icon is mandatory to publish the app to TestFlight/App Store and Google Play. |
| 16 | +
|
| 17 | +### How to generate the assets |
| 18 | + |
| 19 | +First and foremost, we need to take into consideration that automatic generation won't work everytime. |
| 20 | +Sometimes, small adjustments to an icon may be necessary and that should probably be done manually so it looks exactly how it is supposed to. |
| 21 | +There are design tools that solve this problem, e.g. Sketch and Adobe Illustrator, which allow further customization and can assist designers in automatically exporting the icons. |
| 22 | +Nonetheless, automatic generation from a single asset should always be the first step to take as it is the most efficient and effective for most use cases. |
| 23 | + |
| 24 | +> ❗️ The raw app icon asset's resolution should be 1024x1024px or bigger, so it can be used to generate both Android and iOS icons through the recommended generators. |
| 25 | +
|
| 26 | +#### Android |
| 27 | + |
| 28 | +> ❗️ Android 8.0 Oreo introduced adaptive icons and apps running on it or later versions are ought to support them. |
| 29 | +
|
| 30 | +Android assets can be generated using [Image Asset Studio](https://developer.android.com/studio/write/image-asset-studio). |
| 31 | + |
| 32 | +To start Image Asset Studio, follow these steps: |
| 33 | + |
| 34 | +1. Open the project on Android Studio. |
| 35 | +2. In the **Project** window, select the [Android view](https://developer.android.com/studio/projects#ProjectFiles). |
| 36 | +3. Right-click the **res** folder and select **New > Image Asset**. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +The app icon should have both a square and a round version. |
| 41 | +The tool offers a few options which you can tweak as much as you like, but we only cover the necessary ones. |
| 42 | + |
| 43 | +> ℹ️ The following instructions don't cover how to generate [adaptive icons](https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive), which are icons that can display a variety of shapes across different device models. |
| 44 | +> However it isn't much different, actually. To generate those, you should use the **Launcher Icons (Adaptive and Legacy)** option for the **Icon Type**. |
| 45 | +
|
| 46 | +##### Square icons |
| 47 | + |
| 48 | +- **Icon Type** should be the **Launcher Icons (Legacy only)** option. |
| 49 | +- **Name** should be renamed from `ic_launcher` to `app_icon`. |
| 50 | +- **Asset Type** should be **Image** and the raw app icon path should be given. |
| 51 | +- **Shape** should be **Square**. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +After that you should click on **Next** and finally on the **Finish** button. |
| 56 | + |
| 57 | +##### Round icons |
| 58 | + |
| 59 | +- **Icon Type** should be the **Launcher Icons (Legacy only)** option. |
| 60 | +- **Name** should be renamed from `ic_launcher` to `app_icon_round`. |
| 61 | +- **Asset Type** should be **Image** and the raw app icon path should be given. |
| 62 | +- **Shape** should be **Circle**. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +After that you should click on **Next** and finally on the **Finish** button. |
| 67 | + |
| 68 | +##### Google Play icon |
| 69 | + |
| 70 | +Having a proper Google Play icon can help your app attract new users. |
| 71 | +This icon won't replace your app's launcher icon, it will be used in various locations on Google Play instead. |
| 72 | + |
| 73 | +> 💡 Note that the Google Play icon isn't generated by the Image Asset Studio, so it should be manually created by following the [official design specifications](https://developer.android.com/google-play/resources/icon-design-specifications). |
| 74 | +
|
| 75 | +How to upload the icon: |
| 76 | + |
| 77 | +1. Sign in to your [Play Console](https://play.google.com/apps/publish/). |
| 78 | +2. Click **All Applications**. |
| 79 | +3. Select an app. |
| 80 | +4. On the left menu, click **Store Presence > Store listing**. |
| 81 | +5. Under "Graphic Assets" you can upload your images, including the Google Play icon (Hi-res icon). |
| 82 | + |
| 83 | +#### iOS |
| 84 | + |
| 85 | +iOS assets can be generated using [App Icon Generator](https://appicon.co/). |
| 86 | +In the "iOS and macOS" section, only `iPhone` and `iPad` should be selected. |
| 87 | +It is possible to either click and browse the image source or simply drag and drop it. |
| 88 | +After selecting the image, click on the "Generate" button to download the assets. |
| 89 | + |
| 90 | +We can also recommend the [Fueled/ios-icon-generator](https://github.com/Fueled/ios-icon-generator) tool, which is a command line interface (CLI) that generates the icons. |
| 91 | + |
| 92 | +Although not mandatory, we recommend to rename the generated assets according to the following pattern: `<resolution>@x<multiplier>`. |
| 93 | +This way, it becomes makes easier to identify the attributes of each icon and their purpose simply by glancing at its name. |
| 94 | + |
| 95 | +### Output assets location |
| 96 | + |
| 97 | +#### Android |
| 98 | + |
| 99 | +> 💡 Note that if you used Image Asset Studio, you won't have to bother about this, because the tool automatically places the assets into the correct locations. |
| 100 | +
|
| 101 | +##### Square icons: |
| 102 | + |
| 103 | +- **mdpi (48x48@1x):** `android/app/src/main/res/mipmap-mdpi/app_icon.png` |
| 104 | +- **hdpi (72x72@1\.5x):** `android/app/src/main/res/mipmap-hdpi/app_icon.png` |
| 105 | +- **xhdpi (96x96@2x):** `android/app/src/main/res/mipmap-xhdpi/app_icon.png` |
| 106 | +- **xxhdpi (144x144@3x):** `android/app/src/main/res/mipmap-xxhdpi/app_icon.png` |
| 107 | +- **xxxhdpi (192x192@4x):** `android/app/src/main/res/mipmap-xxxhdpi/app_icon.png` |
| 108 | + |
| 109 | +##### Round icons: |
| 110 | + |
| 111 | +- **mdpi (48x48@1x):** `android/app/src/main/res/mipmap-mdpi/app_icon_round.png` |
| 112 | +- **hdpi (72x72@1\.5x):** `android/app/src/main/res/mipmap-hdpi/app_icon_round.png` |
| 113 | +- **xhdpi (96x96@2x):** `android/app/src/main/res/mipmap-xhdpi/app_icon_round.png` |
| 114 | +- **xxhdpi (144x144@3x):** `android/app/src/main/res/mipmap-xxhdpi/app_icon_round.png` |
| 115 | +- **xxxhdpi (192x192@4x):** `android/app/src/main/res/mipmap-xxxhdpi/app_icon_round.png` |
| 116 | + |
| 117 | +After moving the assets to the following locations, there is nothing more to do. |
| 118 | + |
| 119 | +#### iOS |
| 120 | + |
| 121 | +There are two options: either you manually move the icons and reflect the changes on the `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/Contents.json` file or |
| 122 | +drag and drop the assets using XCode, which will automatically update it. |
| 123 | + |
| 124 | +Using XCode: |
| 125 | + |
| 126 | +In the project tree, navigate to `reactNativeWithMoxy > Images.xcassets`. |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | +Now you should be able to drag and drop each asset to its correct location. |
| 131 | + |
| 132 | +> ❗️ When the drag and drop approach is used, XCode will change a file's name if it's already being used for another purpose. |
| 133 | +> Be sure to manually rename it to its original name on `Contents.json`. |
| 134 | +
|
| 135 | +| Before | After | |
| 136 | +| :-----------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | |
| 137 | +|  |  | |
| 138 | + |
| 139 | +##### iPhone Notifications (iOS 7-13 20pt) |
| 140 | + |
| 141 | +- **40x40@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 142 | +- **60x60@3x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 143 | + |
| 144 | +##### iPhone Settings (iOS 7-13 29pt) |
| 145 | + |
| 146 | +- **58x58@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 147 | +- **87x87@3x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 148 | + |
| 149 | +##### iPhone Spotlight (iOS 7-13 40pt) |
| 150 | + |
| 151 | +- **80x80@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 152 | +- **120x120@3x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 153 | + |
| 154 | +##### iPhone App (iOS 7-13 60pt) |
| 155 | + |
| 156 | +- **120x120@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 157 | +- **180x180@3x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 158 | + |
| 159 | +##### iPad Notifications (iOS 7-13 20pt) |
| 160 | + |
| 161 | +- **20x20@1x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 162 | +- **40x40@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 163 | + |
| 164 | +##### iPad Settings (iOS 7-13 29pt) |
| 165 | + |
| 166 | +- **29x29@1x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 167 | +- **58x58@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 168 | + |
| 169 | +##### iPad Spotlight (iOS 7-13 40pt) |
| 170 | + |
| 171 | +- **40x40@1x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 172 | +- **80x80@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 173 | + |
| 174 | +##### iPad App (iOS 7-13 76pt) |
| 175 | + |
| 176 | +- **76x76@1x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 177 | +- **152x152@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 178 | + |
| 179 | +##### iPad Pro App (iOS 7-13 83.5pt) |
| 180 | + |
| 181 | +- **167x167@2x **: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/[email protected]` |
| 182 | + |
| 183 | +##### App Store (iOS 1024pt) |
| 184 | + |
| 185 | +- **1024x1024**: `ios/reactNativeWithMoxy/Images.xcassets/AppIcon.appiconset/1024x1024.png` |
| 186 | + |
| 187 | +### References |
| 188 | + |
| 189 | +- [App Icon - Icons and Images - iOS - Human Interface guidelines](https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/app-icon/) |
| 190 | +- [Google Play icon design specifications](https://developer.android.com/google-play/resources/icon-design-specifications) |
| 191 | +- [Understanding Android Adaptive Icons - Google Design](https://medium.com/google-design/understanding-android-adaptive-icons-cee8a9de93e2) |
| 192 | +- [Designing Adaptive Icons - Google Design](https://medium.com/google-design/designing-adaptive-icons-515af294c783) |
| 193 | +- [Implementing Adaptive Icons - Android Developers](https://medium.com/androiddevelopers/implementing-adaptive-icons-1e4d1795470e) |
0 commit comments