How to reduce Xcode project file size

 ̄綄美尐妖づ 提交于 2020-01-06 13:13:27

问题


So I am trying to submit my WWDC scholarship app, however the file size limit is 100mb, and mine is currently 132mb. I have spent the past few hours reducing the size of the images, and compressing them, but I only saved about 10mb...

So now I am trying to figure out what is taking up all of the space, and what I can delete to get it under 100mb.

I noticed that when I go into the 'Developer' folder and right click on my project and tap 'Get info', it shows that the file is 132mb, however if I go in and check the three folders individually they only add up to about 40mb.

If I go to ~/Library/Developer/DerivedData then the file for this project is about 250mb, so is there something in there that can be deleted?

Thanks in advance!


回答1:


~/Library/Developer/DerivedData can be deleted in its entirety at any time. However, doing so will not affect the size of the app.

Looks first at any assets that you have included, images, videos, sounds, data, and fonts. Figure out what can be eliminated, reduced, or hosted externally. Many times you can replace large images with drawing code.




回答2:


Select your project target > Build Settings, check your VALID_ARCHS:

Remove useless ones, only keep right & less archs for your project, more archs will lead the final archived binary bigger. I think you can only keep x86_64 there in this case.


More reading about the ARCH, you can take a look at THIS ANSWER (it's about iOS).




回答3:


I finally found the problem. I used the terminal command to uncover hidden files, and found that there was a .git file in the folder which was taking up 93mb. I have now deleted the file and it brought down the size to 37mb.



来源:https://stackoverflow.com/questions/29879093/how-to-reduce-xcode-project-file-size

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!