ios `uicache` 命令在越狱 iPhone 上有什么作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44605125/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:14:41  来源:igfitidea点击:

What does `uicache` command do on jailbreak iphone?

iosjailbreakcydia

提问by Siguza

I use the command Whenever I install a jailbreak app and the app's icon doesn't show up. What are some of the command's other use cases? What's the mechanism behind the command?

每当我安装越狱应用程序并且应用程序的图标不显示时,我都会使用该命令。该命令还有哪些其他用例?命令背后的机制是什么?

回答by Siguza

SpringBoard (the "home screen" application) keeps a cache of all app icons. When installing or removing apps from the App Store, installdperforms those changes and updates that cache to reflect them. When installing apps by other means (such as through Cydia), installdis not involved in any way, so for the app to show up properly on the home screen, the cache has to be updated "manually" somehow.
That is exactly what uicachewas designed to do. How exactly it achieves that varies between iOS version, but it's mostly a combination of removing the cache files, killing/reloading the services dealing with them and iterating over the installed applications to build a new cache.

SpringBoard(“主屏幕”应用程序)保留所有应用程序图标的缓存。从 App Store 安装或删除应用程序时,installd执行缓存以反映它们的更改和更新。通过其他方式(例如通过 Cydia)安装应用程序时,installd不涉及任何方式,因此要使应用程序正确显示在主屏幕上,必须以某种方式“手动”更新缓存。
这正是uicache其设计目的。它究竟如何实现这一点因 iOS 版本而异,但它主要是删除缓存文件、杀死/重新加载处理它们的服务以及迭代已安装的应用程序以构建新缓存的组合。

You can check its source code on saurik's git repo.

你可以在 saurik 的 git repo 上查看它的源代码。