如何在越狱的iOS设备上访问沙箱外部的文件系统? [英] How do I access the filesystem outside of the sandbox on a jailbroken iOS device?

查看:139
本文介绍了如何在越狱的iOS设备上访问沙箱外部的文件系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将为越狱的iOS设备开发一个简单的应用程序.我想访问应用程序沙箱之外的设备的文件系统,并将一些文件(例如,从目录移动到另一个目录).

I'm going to develop a simple app for jailbroken iOS devices. I would like to access the filesystem of the device outside of the app's sandbox and move some files (from a directory to another, for example).

如何使用兼容OS版本3.1.3的Xcode 3.1或4来做到这一点?

How can I do this using Xcode 3.1 or 4, compatible with OS version 3.1.3?

推荐答案

只需使用NSFileManager.在越狱设备上,它为您提供了对文件系统的完全访问权限,只需为其提供您要弄乱的路径即可.您可以使用-contentsOfDirectoryAtPath:error:方法获取目录的内容,并使用-moveItemAtPath:toPath:error:来移动文件.

Just use NSFileManager. On a jailbroken device, it gives you full access to the filesystem—just give it the paths you want to mess with. You can get the contents of a directory with its -contentsOfDirectoryAtPath:error: method and move files around with -moveItemAtPath:toPath:error:.

这篇关于如何在越狱的iOS设备上访问沙箱外部的文件系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆