IOS App Size Checker Tool

I am working with an iOS app that uses both objective c and fast code. Nowadays, the size of the IPA application has gotten so big. Some resources are included but may not be used in the final IPA. I want to find which resource should be removed and which resource is increasing the size of my application unnecessarily. I am wondering if there is any xcode tool or profiler out there to analyze and fix this issue.

thank

+3


source to share


2 answers


So far the best tool I have found is https://github.com/tinymind/LSUnusedResources

LSUnusedResources

Mac app for finding unused images and resources in an Xcode project. It is heavily influenced by Jeffhodnett's Unused, but Unused is very slow and the results are not entirely correct. So he did some performance optimization, the search speed is faster than not being used.

Exporting an unused resource list

Use this tool and export unused / unregistered resource list to unused.txt



enter image description here

Remove links from Xcode.pbxproj file

Use the below python script to remove links from project.pbxproj file,

file = open("unused.txt","r")
data = [line.rstrip('\n') for line in open("project.pbxproj", 'r')]
newFile = open("project2.pbxproj","w")

def removeLine(imageName):
        temp = data 
        for line_s in temp:
                if line_s.find(imageName) != -1:
                        data.remove(line_s)
                else:
                        continue        

for line in file:
        if (len(line) > 5):
                tokens = line.split("/")
                len_a = len(tokens)
                imageName =  tokens[len_a-1]
                removeLine(imageName.rstrip('\n'))

for line in data:
        newFile.write(line)
        newFile.write('\n')

      

+2


source


First of all, are you using the latest version of Xcode? Xcode 8.3 creates binaries 2-3 times larger than Xcode 8.2 and Apple fixed this bug in 8.3.1.

Alternatively, you can check out On Demand Resources , which will allow you to upload your heavy assets to the App Store, but the app is not included - and when a user downloads your app, iOS will automatically download the necessary resources for the app to run properly.

You can change the file .ipa

to an extension .zip

and unzip it. You can later use a simple scan ( Disk Inventory X , for example) of the unarchived file .zip

and see what happens there.



It is also likely that you are viewing a view in the App Store .ipa

that will contain the required files dSYM

and other miscellaneous data.

You can check the App Store sizes .ipa

for different devices the app will have by following the steps below in this answer .

Last but not least, check out this Q&A from Apple on reducing the size of your app.

+3


source







All Articles