ios 在模拟器上查找保存的文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9712551/
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
Finding a saved file on the Simulator?
提问by spring
I'm using the MusicSequenceFileCreate
function to save out a midi file to make sure the data is correct. I'm not getting any errors but I would like to view the saved file but have no idea how to do this.
我使用的MusicSequenceFileCreate
功能,节省出的MIDI文件,以确保数据的正确性。我没有收到任何错误,但我想查看保存的文件,但不知道如何执行此操作。
I know I can try reading it in in iOS but I would like to view it (and test it) on the desktop.
我知道我可以尝试在 iOS 中阅读它,但我想在桌面上查看(并测试)它。
Is this file stored in some Simulator cache that I can access?
该文件是否存储在我可以访问的某个模拟器缓存中?
采纳答案by Dave Anderson
Yes the you can access the Simulator files from ~/Library/Application Support/iPhone Simulator/
.
是的,您可以从~/Library/Application Support/iPhone Simulator/
.
In this folder are the various iOS version numbers so pick the one you are running. In that will be Applications
and you'll see a bunch of GUIDs, one of which will be the running app.
此文件夹中包含各种 iOS 版本号,因此请选择您正在运行的版本号。在那里Applications
你会看到一堆 GUID,其中一个是正在运行的应用程序。
One thing in OSX 10.7 is that the Library folder is now hidden. This article explains how to restore the visibility; Show User Library Directory in Mac OS X 10.7 Lion
OSX 10.7 中的一件事是 Library 文件夹现在是隐藏的。这篇文章解释了如何恢复可见性;在 Mac OS X 10.7 Lion 中显示用户库目录
回答by v01pe
The location changed for Xcode 6 with iOS 8:
Xcode 6 和 iOS 8 的位置发生了变化:
~/Library/Developer/CoreSimulator/Devices/DEVICE_UDID/data/Containers/Data/Application/APPLICATION_ID/Documents
DEVICE_UDID
: can be found out in the Device Inspector (Window -> Devices) and Select the simulated device you're running on. The field Identifier
contains the device's UDID.
You can also get a list of the simulator UDID's by running the command xcrun simctl list
(thanks @JeremyHuddlestonSequoia)
DEVICE_UDID
:可以在设备检查器(窗口 -> 设备)中找到并选择您正在运行的模拟设备。该字段Identifier
包含设备的 UDID。
您还可以通过运行命令来获取模拟器 UDID 的列表xcrun simctl list
(感谢 @JeremyHuddlestonSequoia)
APPLICATION_ID
: I didn't find this number somewhere, so I looked into the folders until I found what I wanted. If someone finds out where this number comes from, let me know.
EDIT:The ID of the application changes every time you start the simulator, but when you keep a finder window open pointing to that folder, you'll always find yourself in the correct folder (no idea how they do that; every other application seems to loose track of the files), which is extremely handy!
APPLICATION_ID
: 我没有在某处找到这个号码,所以我查看了文件夹,直到找到我想要的。如果有人知道这个数字的来源,请告诉我。
编辑:每次启动模拟器时,应用程序的 ID 都会更改,但是当您打开指向该文件夹的查找器窗口时,您总会发现自己位于正确的文件夹中(不知道他们是如何做到的;每个其他应用程序似乎来跟踪文件),这非常方便!
回答by joliejuly
You also may just go to the ~/Library/Developer/CoreSimulator/Devices/
folder in Finder (Shift+Cmd+G
), and then click on the Date modified
tab on the top of the folder menu. You'll get the most recently used simulator folder without UDID.
您也可以直接前往~/Library/Developer/CoreSimulator/Devices/
Finder ( Shift+Cmd+G
) 中的文件夹,然后单击Date modified
文件夹菜单顶部的选项卡。您将获得最近使用的没有 UDID 的模拟器文件夹。
After that, I navigate to data/Containers/Data/Application
by hand. In the Application
folder, grace to the Date modified
preference chosen in Finder earlier, I also see the most recent folder on top - and there is no need to know the Application ID as well!
之后,我data/Containers/Data/Application
手动导航到。在Application
文件夹中,根据Date modified
之前在 Finder 中选择的首选项,我还可以在顶部看到最新的文件夹 - 而且不需要知道应用程序 ID!
回答by CodaFi
Simulator files can be found by pressing ?+?+G in the finder at this path:
在此路径的查找器中按 ?+?+G 可以找到模拟器文件:
/Users/USER_NAME/Library/Application Support/iPhone Simulator/User/Applications
/Users/USER_NAME/Library/Application Support/iPhone Simulator/User/Applications
The Library folder may be hidden (to prevent non-devs from accessing it, especially on lion), but thisshows you how to find it again:
该库文件夹可能是隐藏的(防止非开发者对其进行访问,特别是在狮子),但这个节目你怎么找了一遍: