iOS开发者可以查看文件系统吗?
我想知道开发人员是否有某种方法可以在不越狱设备的情况下查看 iOS 设备上的文件系统(例如 iFile)? 需要它用于开发目的。
编辑 感谢您的回答!我知道应用程序文件夹中有一个位置可以读取和写入。 但我一直在寻找一种无需编码即可快速查看数据的方法,例如 iFile。这样我就可以检查我的写入功能是否成功。
I wonder if developer has some sort of ways to be able to view file system on iOS device like iFile but without jailbreak the device?
Need it for devlopement purpose.
EDIT
Thanks for your answers! I know there is a place inside app folder and can be read and write to.
But I was looking for a way to view the data quickly without coding, like iFile. So I can check if my write functions suceed or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
虽然 iDevice 上的文件系统是沙盒的,但 iPhone Simulator 中的文件系统却不是。您可以使用模拟器运行您的应用程序并通过以下方式检查内容:
它应该可以满足您的需求。
While the file system on the iDevice is sandboxed, the one in iPhone Simulator is not. You can run your app with the simulator and check the content via:
It should work for your needs.
对于设备:使用桌面应用程序 iPhone-Explorer 它通过 USB 读取文件系统(它可以读取并为 iPhoneSimulator 写入整个用户指定区域(应用程序、音乐、照片、视频、笔记等),但不是整个系统,除非你越狱并安装 afc2add)
(如 Liz 提到的):
~/Library/Application Support/iPhone Simulator/5.0/Applications
For device: use the desktop-application iPhone-Explorer it reads the filesystem via USB (It can read and write the entire user-designated zone (applications, music, photos, videos, notes, etc.), but not the entire system unless you jailbreak and install afc2add)
for iPhoneSimulator (like Liz mentioned):
~/Library/Application Support/iPhone Simulator/5.0/Applications
人们可以在 iOS 设备中查看文件,但只能在您的应用程序的沙箱中查看。每个应用程序都有一个
Documents
、Cache
和temp
文件夹。我认为前两个是在您连接设备时由 iTunes 自动备份的,后者不会备份。例如,获取缓存目录路径 -
查看
caches
目录中的所有文件 -One can view files in an iOS device but only in that your App's sandbox. Every App has got a
Documents
,Cache
andtemp
folders. I think the first two are automatically backed up by iTunes when you connect your device, the latter is not backed up.Example, to get Cache directory path -
To see all files in
caches
directory -是的,您可以访问文件系统。但是,您仅限于自己的应用程序沙箱。而且您无法更改应用程序包,您作为应用程序一部分下载的所有内容都无法更改(出于安全原因,因为每个应用程序都经过签名)。但您可以将文件存储在应用程序的文档文件夹中。
看看这个讲座,解释了你需要知道的一切:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/lectures/09_Data.pdf
Yeah you can access the filesystem. You are limited to your own application sandbox only however. And you cannot make changes to the app bundle, everything you download as part of the app, this cannot be changed (for security reasons because every app is signed). But you can store files in your app's Documents folder.
Have a look at this lecture, explains everything you need to know:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/lectures/09_Data.pdf
如果您将 plist 中的 UIFileSharingEnabled 键设置为 true,那么您将能够在 Mac 上使用 iTunes 查看应用程序沙盒文档目录中的文件系统,而无需额外编码。如果您想查看缓存目录或查看应用程序沙箱之外的内容,这将无济于事。
If you set a UIFileSharingEnabled key in your plist as true, then you will be able to use iTunes on your Mac to view the file system inside your app's sandboxed Documents directory without additional coding. This won't help if you want to view your Caches directory or look outside your app's sandbox.
当您的 iOS 设备连接到计算机并正确配置用于开发时,您可以使用 Xcode 4 下载您自己项目的文件,而不仅仅是 Documents 目录中的文件。
请参阅另一个答案:How to download app data in Xcode 4.2
When your iOS device is connected to your computer and correctly provisioned for development, you can use Xcode 4 to download files for your own projects, and not only the files in the Documents directory.
Refer to this other answer: How to download app data in Xcode 4.2
可以,有一个示例。你可以看看。
Can, there have a sample. you can have a look.
是的,lms 是正确的。 Apple 已将文件访问权限限制为应用程序本身(文档目录)。所以没有其他方法可以访问它。我在一个项目中遇到了这个问题,我开始开发完整的文件访问系统。像 iFile 一样支持所有操作。您可以像 iFile 应用程序一样直观地完成所有操作。
https://github.com/CianApple/FileSystem
我已将该项目发布到 github 上供公众使用。请随意使用它。它可能会帮助您解决您的问题。
Yes lms is correct. Apple has limited the file access to just the app itself's (Document directory). So there is no other way of accessing it. I faced this issue in one of my projects and I started developing the full file accessing system. All operations are supported like iFile. You can do everything similarly as iFile app visually.
https://github.com/CianApple/FileSystem
I have posted the project on github for public. Feel free to use it. It might help you with your issue.
itools 是一个围绕苹果保护 iPhone 的小工具。因此,它可能会违反苹果的一些政策,但确实可以完成工作
itools is a little tool that works around apples efforts to protect the iPhone. it therefor might infringe with some of apples policies but does the job