App Thinning: slicing, bitcode, and on-demand resources
download-size optimization mechanisms.
slicing delivers only the assets and code a device needs; bitcode let Apple recompile and re-optimize; on-demand resources defer large assets until requested.
WHAT THIS TESTS The interviewer probes whether you can distinguish three distinct size-reduction techniques and articulate exactly what each one optimizes rather than blurring them together.
A GOOD ANSWER COVERS Slicing is the App Store building and delivering device-specific variants of your app from the universal build you upload, so a given device downloads only the executable architecture and the asset catalog resources, such as the matching image scale, that it actually needs, instead of every variant. Bitcode was an LLVM intermediate representation embedded in the upload that allowed Apple to recompile and re-optimize the app binary on its servers, including targeting future architecture or compiler improvements without you resubmitting; note Apple has since deprecated bitcode. On-demand resources are asset bundles you tag and that Apple hosts; the app downloads a tag's resources only when it requests them at runtime and the system can purge them when storage is low, keeping the initial install lean.
COMMON WRONG ANSWERS Claiming bitcode itself reduces the user's download; its purpose was server-side recompilation and optimization, while slicing is what trims the delivered size. Confusing on-demand resources with general lazy loading from your own server. Treating all three as the same feature.
LIKELY FOLLOW-UPS Which of these is still used today given bitcode's deprecation? How do asset catalogs enable slicing? How do you tag resources for on-demand delivery and handle their lifecycle?
ONE CONCRETE EXAMPLE Slicing: a 3x iPhone downloads only the 3x app icon and image set, not the 1x and 2x variants meant for other devices. Bitcode: by embedding it, Apple could recompile your binary to take advantage of a new optimizer without you uploading again. On-demand resources: a game tags level-ten artwork as an on-demand bundle, so the initial install excludes those large textures and the device fetches them only when the player reaches level ten, then frees them under storage pressure.
Read the original → developer.apple.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.