Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Changing iOS app icon
QtWS25 Last Chance

Changing iOS app icon

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Augustas
    wrote on 6 Jan 2022, 07:57 last edited by Augustas 1 Jun 2022, 07:58
    #1

    Hello, I'm having trouble setting an app icon when building for iOS.

    I was following Platform Notes - iOS article, and I've managed to add an icon to my app after editing the Info.plist manually.
    However, this doesn't seem to be a viable solution, since a new version of Info.plist file is generated each time I do a Qt build. Also, app icon after I tab out of it seems to be missing:
    Image

    Adding elements to Info.plist in the .pro file seems to be impossible.

    Is there a proper way to do this?

    J 1 Reply Last reply 6 Jan 2022, 08:02
    0
    • A Augustas
      6 Jan 2022, 07:57

      Hello, I'm having trouble setting an app icon when building for iOS.

      I was following Platform Notes - iOS article, and I've managed to add an icon to my app after editing the Info.plist manually.
      However, this doesn't seem to be a viable solution, since a new version of Info.plist file is generated each time I do a Qt build. Also, app icon after I tab out of it seems to be missing:
      Image

      Adding elements to Info.plist in the .pro file seems to be impossible.

      Is there a proper way to do this?

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 6 Jan 2022, 08:02 last edited by
      #2

      hi @Augustas

      usually one makes a copy of the info.plist file and store that copy inside your source files.
      than inside the pro file you specify the path to that stored info.plist file via QMAKE_INFO_PLIST variable. For example:

      ios{
          QMAKE_INFO_PLIST = iOS/Info.plist
      }
      

      changing the AppIcon, or adding one in your case, requires a complete reinstall and cache cleaning to be visible. Its been that way in iOS for a long time :(


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      A 1 Reply Last reply 6 Jan 2022, 09:23
      3
      • J J.Hilk
        6 Jan 2022, 08:02

        hi @Augustas

        usually one makes a copy of the info.plist file and store that copy inside your source files.
        than inside the pro file you specify the path to that stored info.plist file via QMAKE_INFO_PLIST variable. For example:

        ios{
            QMAKE_INFO_PLIST = iOS/Info.plist
        }
        

        changing the AppIcon, or adding one in your case, requires a complete reinstall and cache cleaning to be visible. Its been that way in iOS for a long time :(

        A Offline
        A Offline
        Augustas
        wrote on 6 Jan 2022, 09:23 last edited by Augustas 1 Jun 2022, 09:25
        #3

        hi @J-Hilk, thank you for the reply :)

        The solution seems kind of a hassle, but hey, it works!

        I can see the icon when my app is on my home screen, however, the issue persist, that I can't see an icon when the app is tabbed out (as shown in screenshot before). I'm testing this on an iPhone 5SE with iOS software 14.8.1
        In "Platform Notes - iOS" article there's a mention "The filename is not important, but the actual pixel size is.", I've tried all kinds of icon sizes, I've added all of them to QMAKE_BUNDLE_DATA, but the tabbed out app icon still isn't present. My Info.plist file looks like this:

        <?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>CFBundleDisplayName</key>
        	<string>TestApp</string>
        	<key>CFBundleExecutable</key>
        	<string>${EXECUTABLE_NAME}</string>
        	<key>CFBundleIconFile</key>
        	<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
        	<key>CFBundleIcons</key>
        	<dict>
        		<key>CFBundlePrimaryIcon</key>
        		<dict>
        			<key>CFBundleIconFiles</key>
        			<array>
        				<string>AppIcon20x20.png</string>
        				<string>AppIcon29x29.png</string>
        				<string>AppIcon29x29@2x.png</string>
        				<string>AppIcon40x40@2x.png</string>
        				<string>AppIcon57x57.png</string>
        				<string>AppIcon57x57@2x.png</string>
        				<string>AppIcon60x60.png</string>
        				<string>AppIcon60x60@2x.png</string>
        				<string>AppIcon29x29~ipad.png</string>
        				<string>AppIcon29x29@2x~ipad.png</string>
        				<string>AppIcon40x40~ipad.png</string>
        				<string>AppIcon40x40@2x~ipad.png</string>
        				<string>AppIcon50x50~ipad.png</string>
        				<string>AppIcon50x50@2x~ipad.png</string>
        				<string>AppIcon72x72~ipad.png</string>
        				<string>AppIcon72x72@2x~ipad.png</string>
        				<string>AppIcon76x76~ipad.png</string>
        				<string>AppIcon76x76@2x~ipad.png</string>
        				<string>AppIcon87x87.png</string>
        				<string>AppIcon120x120.png</string>
        				<string>AppIcon167x167.png</string>
        				<string>AppIcon180x180.png</string>
        				<string>AppIconiTunesArtwork.png</string>
        				<string>AppIconiTunesArtwork@2x.png</string>
        			</array>
        		</dict>
        	</dict>
        	<key>CFBundleIcons~ipad</key>
        	<dict>
        		<key>CFBundlePrimaryIcon</key>
        		<dict>
        			<key>CFBundleIconFiles</key>
        			<array>
        				<string>AppIcon20x20.png</string>
        				<string>AppIcon29x29.png</string>
        				<string>AppIcon29x29@2x.png</string>
        				<string>AppIcon40x40@2x.png</string>
        				<string>AppIcon57x57.png</string>
        				<string>AppIcon57x57@2x.png</string>
        				<string>AppIcon60x60.png</string>
        				<string>AppIcon60x60@2x.png</string>
        				<string>AppIcon29x29~ipad.png</string>
        				<string>AppIcon29x29@2x~ipad.png</string>
        				<string>AppIcon40x40~ipad.png</string>
        				<string>AppIcon40x40@2x~ipad.png</string>
        				<string>AppIcon50x50~ipad.png</string>
        				<string>AppIcon50x50@2x~ipad.png</string>
        				<string>AppIcon72x72~ipad.png</string>
        				<string>AppIcon72x72@2x~ipad.png</string>
        				<string>AppIcon76x76~ipad.png</string>
        				<string>AppIcon76x76@2x~ipad.png</string>
        				<string>AppIcon87x87.png</string>
        				<string>AppIcon120x120.png</string>
        				<string>AppIcon167x167.png</string>
        				<string>AppIcon180x180.png</string>
        				<string>AppIconiTunesArtwork.png</string>
        				<string>AppIconiTunesArtwork@2x.png</string>
        			</array>
        		</dict>
        	</dict>
        	<key>CFBundleIdentifier</key>
        	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        	<key>CFBundleName</key>
        	<string>${PRODUCT_NAME}</string>
        	<key>CFBundlePackageType</key>
        	<string>APPL</string>
        	<key>CFBundleShortVersionString</key>
        	<string>$(MARKETING_VERSION)</string>
        	<key>CFBundleSignature</key>
        	<string>${QMAKE_PKGINFO_TYPEINFO}</string>
        	<key>CFBundleVersion</key>
        	<string>$(CURRENT_PROJECT_VERSION)</string>
        	<key>LSRequiresIPhoneOS</key>
        	<true/>
        	<key>MinimumOSVersion</key>
        	<string>${IPHONEOS_DEPLOYMENT_TARGET}</string>
        	<key>NOTE</key>
        	<string>This file was generated by Qt/QMake.</string>
        	<key>UILaunchStoryboardName</key>
        	<string>LaunchScreen</string>
        	<key>UISupportedInterfaceOrientations</key>
        	<array>
        		<string>UIInterfaceOrientationPortrait</string>
        		<string>UIInterfaceOrientationPortraitUpsideDown</string>
        		<string>UIInterfaceOrientationLandscapeLeft</string>
        		<string>UIInterfaceOrientationLandscapeRight</string>
        	</array>
        </dict>
        </plist>
        
        

        I've tried to add all of the required icons to some native XCode projects Assets.xcassets tab and it works fine. Any idea how to make it work on Qt generated XCode project?

        J 1 Reply Last reply 6 Jan 2022, 09:25
        0
        • A Augustas
          6 Jan 2022, 09:23

          hi @J-Hilk, thank you for the reply :)

          The solution seems kind of a hassle, but hey, it works!

          I can see the icon when my app is on my home screen, however, the issue persist, that I can't see an icon when the app is tabbed out (as shown in screenshot before). I'm testing this on an iPhone 5SE with iOS software 14.8.1
          In "Platform Notes - iOS" article there's a mention "The filename is not important, but the actual pixel size is.", I've tried all kinds of icon sizes, I've added all of them to QMAKE_BUNDLE_DATA, but the tabbed out app icon still isn't present. My Info.plist file looks like this:

          <?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>CFBundleDisplayName</key>
          	<string>TestApp</string>
          	<key>CFBundleExecutable</key>
          	<string>${EXECUTABLE_NAME}</string>
          	<key>CFBundleIconFile</key>
          	<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
          	<key>CFBundleIcons</key>
          	<dict>
          		<key>CFBundlePrimaryIcon</key>
          		<dict>
          			<key>CFBundleIconFiles</key>
          			<array>
          				<string>AppIcon20x20.png</string>
          				<string>AppIcon29x29.png</string>
          				<string>AppIcon29x29@2x.png</string>
          				<string>AppIcon40x40@2x.png</string>
          				<string>AppIcon57x57.png</string>
          				<string>AppIcon57x57@2x.png</string>
          				<string>AppIcon60x60.png</string>
          				<string>AppIcon60x60@2x.png</string>
          				<string>AppIcon29x29~ipad.png</string>
          				<string>AppIcon29x29@2x~ipad.png</string>
          				<string>AppIcon40x40~ipad.png</string>
          				<string>AppIcon40x40@2x~ipad.png</string>
          				<string>AppIcon50x50~ipad.png</string>
          				<string>AppIcon50x50@2x~ipad.png</string>
          				<string>AppIcon72x72~ipad.png</string>
          				<string>AppIcon72x72@2x~ipad.png</string>
          				<string>AppIcon76x76~ipad.png</string>
          				<string>AppIcon76x76@2x~ipad.png</string>
          				<string>AppIcon87x87.png</string>
          				<string>AppIcon120x120.png</string>
          				<string>AppIcon167x167.png</string>
          				<string>AppIcon180x180.png</string>
          				<string>AppIconiTunesArtwork.png</string>
          				<string>AppIconiTunesArtwork@2x.png</string>
          			</array>
          		</dict>
          	</dict>
          	<key>CFBundleIcons~ipad</key>
          	<dict>
          		<key>CFBundlePrimaryIcon</key>
          		<dict>
          			<key>CFBundleIconFiles</key>
          			<array>
          				<string>AppIcon20x20.png</string>
          				<string>AppIcon29x29.png</string>
          				<string>AppIcon29x29@2x.png</string>
          				<string>AppIcon40x40@2x.png</string>
          				<string>AppIcon57x57.png</string>
          				<string>AppIcon57x57@2x.png</string>
          				<string>AppIcon60x60.png</string>
          				<string>AppIcon60x60@2x.png</string>
          				<string>AppIcon29x29~ipad.png</string>
          				<string>AppIcon29x29@2x~ipad.png</string>
          				<string>AppIcon40x40~ipad.png</string>
          				<string>AppIcon40x40@2x~ipad.png</string>
          				<string>AppIcon50x50~ipad.png</string>
          				<string>AppIcon50x50@2x~ipad.png</string>
          				<string>AppIcon72x72~ipad.png</string>
          				<string>AppIcon72x72@2x~ipad.png</string>
          				<string>AppIcon76x76~ipad.png</string>
          				<string>AppIcon76x76@2x~ipad.png</string>
          				<string>AppIcon87x87.png</string>
          				<string>AppIcon120x120.png</string>
          				<string>AppIcon167x167.png</string>
          				<string>AppIcon180x180.png</string>
          				<string>AppIconiTunesArtwork.png</string>
          				<string>AppIconiTunesArtwork@2x.png</string>
          			</array>
          		</dict>
          	</dict>
          	<key>CFBundleIdentifier</key>
          	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
          	<key>CFBundleName</key>
          	<string>${PRODUCT_NAME}</string>
          	<key>CFBundlePackageType</key>
          	<string>APPL</string>
          	<key>CFBundleShortVersionString</key>
          	<string>$(MARKETING_VERSION)</string>
          	<key>CFBundleSignature</key>
          	<string>${QMAKE_PKGINFO_TYPEINFO}</string>
          	<key>CFBundleVersion</key>
          	<string>$(CURRENT_PROJECT_VERSION)</string>
          	<key>LSRequiresIPhoneOS</key>
          	<true/>
          	<key>MinimumOSVersion</key>
          	<string>${IPHONEOS_DEPLOYMENT_TARGET}</string>
          	<key>NOTE</key>
          	<string>This file was generated by Qt/QMake.</string>
          	<key>UILaunchStoryboardName</key>
          	<string>LaunchScreen</string>
          	<key>UISupportedInterfaceOrientations</key>
          	<array>
          		<string>UIInterfaceOrientationPortrait</string>
          		<string>UIInterfaceOrientationPortraitUpsideDown</string>
          		<string>UIInterfaceOrientationLandscapeLeft</string>
          		<string>UIInterfaceOrientationLandscapeRight</string>
          	</array>
          </dict>
          </plist>
          
          

          I've tried to add all of the required icons to some native XCode projects Assets.xcassets tab and it works fine. Any idea how to make it work on Qt generated XCode project?

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 6 Jan 2022, 09:25 last edited by
          #4

          @Augustas have you added your icon assets in the pro file via QMAKE_ASSET_CATALOGS ?

          e.g:

          QMAKE_ASSET_CATALOGS +=ios/Images.xcassets
          

          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          A 1 Reply Last reply 6 Jan 2022, 09:41
          0
          • J J.Hilk
            6 Jan 2022, 09:25

            @Augustas have you added your icon assets in the pro file via QMAKE_ASSET_CATALOGS ?

            e.g:

            QMAKE_ASSET_CATALOGS +=ios/Images.xcassets
            
            A Offline
            A Offline
            Augustas
            wrote on 6 Jan 2022, 09:41 last edited by
            #5

            @J-Hilk,
            Yes, I have them added like this:

            ios_icon.files = $$files($$PWD/pictures/iOSAppIcons/AppIcon*.png)
            QMAKE_BUNDLE_DATA += ios_icon
            

            and all of the images seem to be present in my Bundle Data folder in the generated XCode project:

            image

            1 Reply Last reply
            0

            3/5

            6 Jan 2022, 09:23

            • Login

            • Login or register to search.
            3 out of 5
            • First post
              3/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved