macos 从 Mac OS X 应用程序访问 iPhone 文件系统

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4579950/
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-10-21 07:31:52  来源:igfitidea点击:

Accessing the iPhone filesystem from a Mac OS X application

iphonemacosfilesystems

提问by zakk

I need to get a file (sms.db) from an iPhone connected to a Mac. I cannot find any way to access the iPhone filesystem searching in Apple Developers Connection...

我需要从连接到 Mac 的 iPhone 获取文件 (sms.db)。我找不到任何方法来访问在 Apple Developers Connection 中搜索的 iPhone 文件系统...

I cannot SSH to the iPhone, the application I want to develop is meant to be used on non-jailbroken iPhones... And I would like to avoid some MacFuse modules I found googling, too... I would like to access the filesystem thru some sort of API, the simpler the better.

我无法通过 SSH 连接到 iPhone,我想开发的应用程序旨在用于未越狱的 iPhone……而且我想避免使用谷歌搜索的一些 MacFuse 模块……我想访问文件系统通过某种 API,越简单越好。

Thanks!

谢谢!

采纳答案by hotpaw2

There is no Apple-documented public API for accessing the entire filesystem on a stock OS iOS device. Even private OS/API calls won't work due to the app sandbox restrictions.

没有 Apple 记录的公共 API 可用于访问股票 OS iOS 设备上的整个文件系统。由于应用程序沙箱限制,即使是私有 OS/API 调用也无法工作。

Xcode, iTunes, and probably other apps that take over the iTunes USB driver, are using a non-Apple-documented private API that only works over the USB connection.

Xcode、iTunes 以及可能接管 iTunes USB 驱动程序的其他应用程序正在使用非 Apple 记录的私有 API,该 API 仅适用于 USB 连接。

回答by rmmoul

This api was developed to allow access to ios devices:

开发这个 api 是为了允许访问 ios 设备:

http://www.libimobiledevice.org/

http://www.libimobiledevice.org/

回答by appMan

It appears that DiskAid silences all nay sayers. That app seems to have complete access to the iOS device filesystem - whether or not iTunes is running and whether or not the files are shared. It even sees files down to root level. I am still trying to figure out how it is done. Oh yea, this is all on a non jailbroken device.

DiskAid 似乎让所有反对者保持沉默。该应用程序似乎可以完全访问 iOS 设备文件系统 - 无论 iTunes 是否正在运行以及文件是否共享。它甚至可以看到文件到根级别。我仍在试图弄清楚它是如何完成的。哦,是的,这一切都在未越狱的设备上。

回答by zoom23

Phoneview (as mentioned in a few comments) does not allow access to the file system. It uses public APIs to get things like call data and contacts, and allows you to copy files into one location on the phone.

Phoneview(如一些评论中所述)不允许访问文件系统。它使用公共 API 来获取诸如通话数据和联系人之类的内容,并允许您将文件复制到手机上的一个位置。

From the FAQ: "PhoneView will store your files in the media section of the iPhone's disk"

来自常见问题解答:“PhoneView 会将您的文件存储在 iPhone 磁盘的媒体部分”

Smoke and mirrors.

烟雾和镜子。

回答by orb

If it's for your own app, use the document sharing included in iOS 4.x. You can then have files show up in iTunes, and drop files from the desktop into your app's section.

如果是用于您自己的应用程序,请使用 iOS 4.x 中包含的文档共享。然后,您可以在 iTunes 中显示文件,并将文件从桌面拖放到您的应用程序部分。

A tutorial is found here: Ray Wenderlich's nice tutorial

这里有一个教程: Ray Wenderlich 的好教程

回答by Nickolay Olshevsky

It is not possible for non-jailbroken iPhone due to file system restrictions.

由于文件系统限制,未越狱的 iPhone 是不可能的。

回答by FrozenWasteland

You can't access the filesystem from an OSX application, the filesystem is locked down.

您无法从 OSX 应用程序访问文件系统,文件系统已锁定。