![]() ![]() I recently spent so much time struggling to understand Xcode mechanics. I hope this answer could help you at least a bit. Here is a StackOverflow thread about Schemes and Configurations differences: understanding Xcode schemes I am conscious that for this example I am using Configuration over Schemes, but for me a Scheme is just a quick way to switch between configurations. ![]() Of course you need to create another IOS App Icon Here I chose AppIcon-Premium for my Premium config To find the setting I must go under Target > Build Settings once again and search for 'Assets Catalog Compiler - Options' under this one I look for another options called 'Asset Catalog App Icon Set Name' and here you can chose a different Icon for any configuration. ![]() The exact same mechanic apply for App Icons. ![]() I need to go under Target > Build Settings and search For 'Product Bundle Identifier' here I can set a different bundle id for each config. For demonstration purpose I've create a test project and added a 'Premium' Configuration.įor instance if I would like to change the Bundle Identifier on my test project. I don't know a lot about React Native configuration but in Xcode you can edit Target's build settings easily. To fix that, we will have to add a Run Script Phase that will revert the changes.If you're already using 'Environment Variables' to modify things like Bundle Identifier, you could totally do the same for AppIcons. Now if you build the app, you will be able to see a different icon for different configurations and versions.īut we are not done yet, there is one last thing! As part of this process, we are changing the AppIcon but we never revert it back to the original state. Then we get the configuration and the version of the build, and, in the same fashion as in the Fastfile, we apply the different texts and colors according to those values. In the snippet above, we first check if the badge command is available or else we print a warning. Appicon xcode install#This lane will look like the following snippet.ĪPP_PROJECT = ".xcodeproj" desc "Add a shield on the App Icon" lane :add_shield do | options | puts options version = get_version_number ( xcodeproj: APP_PROJECT ) if options = "dev" add_badge ( shield: "Dev- # " -no_badge fiĮcho "warning: 'badge' is not installed, run 'sudo /usr/bin/gem install badge'" fi When this command is completed, we can open the fastlane/Fastfile and add a new lane to add the shield on the app icon. To install it, we will run the command bundle exec fastlane add_plugin badge on the root directory of the project. To begin with, there is a fastlane plugin for badge. If not, you can refer to my previous posts and find out how you can setup both Bundler and fastlane on an iOS project. Note: I make the assumption that you already have Bundler and fastlane setup. Let’s first see how we can use it from the Fastfile! The fastlane way If you prefer to create something custom, then ImageMagick is the way to go, as it allows for more freedom and creativity in regards to the position and the style of the shield. badge itself is using ImageMagick but it restricts you to a specific style for the shield. Note: As an alternative to this gem, you can use ImageMagick. It also offers the option to either use it directly from the command like or from fastlane’s Fastfile. Let’s get started! badge gemĪs I mentioned before, badge is a Ruby gem that makes it easy to add a shield or a badge on the app icon. In this post, we are going to see how we can use a Ruby gem name badge to add this shield on the app icon. Wouldn’t it make it much easier to recognize them if we were to add a shield on the app icon with information about the configuration and the version for dev or stage builds? For example, we could add this info on the app name, present it somewhere inside the app, use a settings bundle to show it in the app settings or use a different app icon.Īmong all these options, I personally believe that the most efficient, when using the app, is to change the app icon. You can also provide your custom badge/overlay or add a shield. The good news is that, with a little imagination, we can find multiple alternatives to ease this issue. This action will add a light/dark badge onto your app icon. Have you ever ended up in a situation where you have multiple builds of the same app installed on a device and you find it hard to figure out the configuration and the version of each build? Wouldn’t it be great if we could make it easier to identify which one is which with a single glance? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |