从Application document目录复制文件并移动到iPhone / Application文件夹 - Objective C? [英] Copy file from Application document directory and move to iPhone /Application folder- Objective C?
问题描述
我在某个服务器上有一个ipa / deb文件,通过服务调用我下载该文件并将其保存到我的应用程序文档目录(在app沙箱中)。这个应用程序不是签名的,我必须直接/自动安装在iPhone设备上,无需任何第三方工具,如Cyberduck / iExplorer,甚至不是终端。那么,只有在授予对应用程序的root访问权限或安装应用程序时,如何才能完成编码部分的完整任务。您可以说这个应用程序将像Cydia一样用于应用程序安装。
I have one ipa/deb file there at some server and through service call I download that file and save it to my application document directory (within app sandbox). This app is not the signed one and I have to install it directly/automatically on iPhone device without the help of any third party tool like Cyberduck/iExplorer even not the terminal. So how can I accomplish the complete task with coding part only if it is to grant root access to app or install the app. You can say this app will behave like Cydia for app installation.
提前致谢。
推荐答案
我相信你的意思是 / Applications
而不是 / root / Applications
因为没有这样的文件夹(至少不在我的iOS 5设备上)。
I believe you mean /Applications
instead of /root/Applications
since there is no such folder (at least not on my iOS 5 device).
自 / Applications
folder拥有 root
,其中 755
权限。这意味着,非root用户可以读取/执行该文件夹中的文件,但不能写入该文件夹。如果要写入该文件夹,则需要以 root
的身份运行应用程序。对您而言,这样做的方法是将应用程序安装在 / Applications
文件夹中。 (我认为)如果你通过 Cydia
安装应用程序,这会自动完成。
Since /Applications
folder has is owned by root
with 755
permissions. That means, non-root users can read/execute the files in that folder but not write to it. If you want to write to that folder, you need to run your app as root
. The way to do this, somewhat ironically for you, is to have the app installed in /Applications
folder. (I think) this is automatically done if you install the app through Cydia
.
总结一下:你如果您通过App Store(或临时分发)安装应用程序,则无法将应用程序移动到 / Applications
。您需要通过 Cydia
安装它,它将直接安装在该文件夹中。
So to sum up: You can't move app to /Applications
if you installed it through App Store (or ad hoc distribution). You need to install it through Cydia
and it'll be installed directly in that folder.
此外,该答案你在评论中提到的是关于Mac OS,而不是iOS。
Also, that answer you're referring to in comments, is about Mac OS, not iOS.
这篇关于从Application document目录复制文件并移动到iPhone / Application文件夹 - Objective C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!