Do universal binaries contain all the heavy ipad graphics in the App Bundle on the iPhone? What to do about it?

人走茶凉 提交于 2019-12-10 19:37:07

问题


Since the iPad 3 has a retina display, I start to worry about the amount of "image spam" in universal binaries on iPhone and iPod touch devices. Obviously they don't need those resources.

I never really checked, but maybe someone knows this: When an iPhone downloads a universal binary, does the App Store automatically ship a version where all the heavy iPad graphics have been stripped out? Or is the iPhone or iPod touch flooded with content that's only needed on the iPad?

Are there any ways to make a universal binary "intelligent" such that iPads only receive iPad resources while iPhones only receive iPhone resources?

In my case I have a 10 MB universal app. Upgrading this to retina iPad would mean iPod touch users will suffer from doubled file size.


回答1:


No, nothing is stripped from the app bundle when you install on different devices. Remember, the whole thing is codesigned, so nothing can be stripped or the signature would be invalid. The standard advice here is to just live with the fact that your customer is only going to actually be using half of the resources in your app bundle (or a quarter if you don't share resources between iphone and ipad). If this is a dealbreaker for you, you could consider downloading the necessary resources from a server under your control on first launch, but remember that this makes things very complicated for you, and is actually a pretty poor user experience. You almost certainly want to just live with the increased size.




回答2:


The thing to do is just skip the non retina images because iOS automatically scales images down from their @2x form. Although this may cause slight lag, it is worth it because it will keep the IPA size down and users happy. But if you are doing a game where FPS matters greatly, then you are just going to have to bite the bullet and put all the graphics in there for all devices.




回答3:


There really wouldn't be a great way to do this that wouldn't be annoying to the user. Saying that, you could potentially ship it with just iPhone graphics (or none at all) and then on first launch it would download all the images from a server that are necessary for whatever device it's running on. Like I said that really would not be a good way to do it though. Sticking with the large initial download seems the best in my opinion.



来源:https://stackoverflow.com/questions/9611617/do-universal-binaries-contain-all-the-heavy-ipad-graphics-in-the-app-bundle-on-t

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