如何在 Xcode 4.2 中下载应用程序数据

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

How to download app data in Xcode 4.2

iphoneiosxcode

提问by Jones123

In the latest version of Xcode I could simply go to Organizer->MyDevice->Applications and then select the app I wanted to look at and download the appdata in form of a folder with all the app content. Now I only get a .xcappdata file.

在最新版本的 Xcode 中,我可以简单地转到 Organizer->MyDevice->Applications,然后选择我想要查看的应用程序并以包含所有应用程序内容的文件夹的形式下载应用程序数据。现在我只得到一个 .xcappdata 文件。

How can I access this file for take a look in a .sqlite file?

如何访问此文件以查看 .sqlite 文件?

回答by BoltClock

Under the Data files in Sandboxpane in the Organizer, you'll find all the individual files that the selected app stores on the device and uses, displayed in a hierarchical view.

在管理器中沙盒中数据文件窗格下,您将找到所选应用程序存储在设备上并使用的所有单个文件,以分层视图显示。

For my app, it looks like this:

对于我的应用程序,它看起来像这样:

To view the files in Finder, download the .xcappdata file, go to where you save it in Finder, Control-click on it and choose Show Package Contents. The directory structure is identical to what you see in the Organizer, and you can open and/or copy out the files as usual.

要在 Finder 中查看文件,请下载 .xcappdata 文件,转到您在 Finder 中保存它的位置,按住 Control 键并单击它并选择Show Package Contents。目录结构与您在管理器中看到的相同,您可以照常打开和/或复制文件。

回答by Dean

I'm constantly checking my app's database, so to speed things up I always download the .xcappdata to the same folder. I then run the following script that's sitting in that folder to look at the latest version of the database in 'sqliteman' (a sqlite program available through MacPorts):

我一直在检查我的应用程序的数据库,所以为了加快速度,我总是将 .xcappdata 下载到同一个文件夹。然后,我运行位于该文件夹中的以下脚本,以查看“sqliteman”(可通过​​ MacPorts 获得的 sqlite 程序)中数据库的最新版本:

#!/bin/bash
shopt - nullglob
for PACKAGE in *.xcappdata; do
    CURRENT=$PACKAGE
done
sqliteman "$CURRENT/AppData/Documents/yourapphere.sqlite"