iOS 如何查看真机的沙盒(图文教程)

iOS开发之沙盒机制(SandBox),我们了解到如何查看模拟器的沙盒内容。直接在Finder->前往->前往文件夹里输入:

/Users/ligang/Library/Application Support/iPhone Simulator/ 

这样就可以查看模拟器的沙盒内容。在平时开发中,我们应该大部分用的是真机测试。如果需要在沙盒里操作文件,那么我们可以通过观察真机沙盒的内容,来确定文件操作是否正确。

如果你已经知道如何查看真机的沙盒,请看看其他的文章吧,在这里刚刚在线站内搜索可以搜索到更多iOS开发相关的文章。接下来,通过图文的方式详细讲解如何查看真机沙盒。有兴趣的同学可以继续往下看。

查看真机沙盒教程

打开Devices

在xcode的上部导航栏里,选择window -> Devices

realsandbox1.jpg

找到目标APP

我们拿iOSStrongDemo举例。界面如下图所示:

realsandbox2.jpg

浏览沙盒目录结构

双击iOSStrongDemo

realsandbox3.jpg

点击Show Container

设置图标单击之后,如图所示:

realsandbox4.jpg

这样我们只能看到沙盒的目录结构。看不到实体文件。那么,我们下一步就是找到这个沙盒。

Download Container保存到桌面

如上图所示,有一个Download Container,选择之后,保存到桌面。

realsandbox5.jpg

右键显示包内容

realsandbox6.jpg

查看沙盒目录

AppDataInfo.plist是APP的配置文件:

realsandbox7.jpg

打开AppData

realsandbox8.jpg

这就是APP的沙盒,在这里我们可以对文件进行增删查改操作。更多内容以后继续慢慢分享。

 

本文出处刚刚在线:http://www.superqq.com/blog/2015/07/23/ru-he-cha-kan-zhen-ji-de-sha-he-(tu-wen-jiao-cheng-)/

微信公众号iOS开发:iOSDevTip

Xcode基本操作 标签: XcodeSymbolViewNavigate 2013-11-30 19:34 88483人阅读 评论(19) 收藏 举报 分类: 编程工具&生产效率(10) 版权声明:本文为博主原创文章,未经博主允许不得转载。 目录(?)[+] 1.Xcode IDE概览 说明:从左到右,依次是“导航窗格(Navigator)->边列(Gutter)->焦点列(Ribbon)->代码编辑窗口(Standard/Primary Editor)”。 边列(Gutter):显示行号和断点。 焦点列(Ribbon):灰色深度与代码嵌套深度相关:鼠标悬停可突出显示右侧相应代码块(Focus code blocks on hover),鼠标单击可折叠右侧相应代码块(Code folding)。 2.偏好设置 通过“command+,”快捷键或”Xcode|Preferences”菜单呼出偏好设置。 (1)主题及字体(Preferences->Fonts & Colors) 选中一种主题(theme),例如“Midnight”,推荐使用Monokai、Ciapre。将 `*.dvtcolortheme` 文件拷贝到 `~/Library/Developer/Xcode/UserData/FontAndColorThemes/`即可安装主题, 重启 Xcode 即可选用。 Xcode默认字体为menlo,也可选择 Consolas、Monaco、Consolas、Droid Sans Mono、Source Code Pro、Bitstream Vera Sans 等其他等宽字体。 shift 选择主题 Source Editor/Console 中的所有项,点击 Fonts 可更改字体(大小)。 (2)编辑器配置(Preferences->Text Editing) Editing: Show Line Numbers:在gutter中显示行号。 Code folding ribbon:显示焦点列。 Focus code blocks on hover:鼠标悬停时突出显示右侧相应代码块。 Page guide at column:显示一行最多支持80个字符的提示分割线。 Indentation: Prefer indent using:Spaces(为保持一致的视觉呈现和行末注释对齐,建议使用空格) Tab width:4 spaces(tab expand,1个tab=4个空格) Indent width:4 spaces(自动缩进步长=4个空格) (3)跳转打开方式(Preferences->Navigation) Activation:When a tab or window opens,make it active。当新建窗口或标签时,立即激活聚焦。 Navigation:Uses Primary/Focused Editor。打开Project Navigator中指定的文件时,在主编辑器窗口/当前聚焦窗口打开,建议选择Focused。 Optional Navigation:Uses Single Assistant Editor。打开Project Navigator中指定的文件或跳转到符号定义所在文件(command+单击)时,若按下option键,则在辅助窗口打开。 Double Click Navigation:Uses Separate Tab。双击打开Project Navigator中指定的文件或跳转到符号定义所在文件(command+双击)时,新建标签页。 (4)SCM(Preferences->Source Control) Enable Source Control:启用/禁用Xcode自带Source Control Manager(SCM)。 Comparison View:Show local revision in [Right] Side。打开version editor比较窗口时,左侧显示服务器基线版本(base),[右侧]显示本地修改过的工作拷贝(local working copy)。 (5)SDK/Simulator(Preferences->Downloads) Downloads:可下载Components(SDK&Simulator)和Documentation。 (6)构建输出目录(Preferences->Locations->Locations) 当选择为Default时,Derived Data的目录为~/Library/Developer/Xcode/DerivedData。 当选择为Relative时,Derived Data的目录为当前*.xcodeproj所在的目录。 当选择为Custom时,Derived Data的目录需自定义。 不建议使用绝对路径,因为写死之后,换环境或换平台,又要重新修改路径,且同名project target的build folder会覆盖,建议使用相对路径(Relative) 3.代码阅读 (1)Help option+点按:查看选中符号的帮助提示(Quick Help for Selected Item)。 option+双击:打开选中符号的帮助文档。 (2)View Navigator command+0:Show/Hide left tool panel(Navigator Area) command+1-8:Project/Symbol/Find/Issue/Test/Debug/Breakpoint/Report Navigator option+command+0:Show/Hide right tool panel(Utility Area) option+command+1/2:show the file/quick help inspector 可按下command+0隐藏左侧栏Navigator,再按下option+command+0隐藏右侧栏Utility,只显示Standard/Primary Editor,聚焦有效利用屏幕进行编码。 (3)View Editor Organization control+1:Show Related Items(例如Superclasses/Subclasses、Callers/Callees、Protocol Implementor/Implemented、Includes/Included By)。可输入实时搜索匹配。 control+2/3:Show Previous/Next History。可输入实时搜索匹配。 control+4:Show Top Level Items。 control+5:Show Group Files(当前文件夹内的所有文件)。可输入实时搜索匹配。 control+6:Show Document Items(当前文件的Symbols)。可输入实时搜索匹配。 (4)Eidtor Window/Tab Switch command+shift+[/]:切换标签页 单/双指左右滑动(control+command+←/→):在单标签页打开的多个文件间切换(Go Back/Forward) (5)Symbol Jump command+L:跳转到指定行。 shift+command+O:Open Quickly,快速全局查找文件、符号,非常常用! command+点击Editor中选中的符号:跳转到符号定义(jump to definition)。 control+command+J:跳转到指定符号的定义处或实现处(Go to Declaration/Definition)。有时工程正在Loading、Indexing或Processing files时,“command+点击”无法响应,此时可试试control+command+J。 control+command+↑/↓:切换头文件/实现文件(switch between a source file (.m,*.mm,*.cc) and the associated header file(.h),Jump to Previous/Next Counterpart)。 在Project Navigator中选中文件右键或通过菜单“File->Show in Finder”:在Finder中定位该文件。 (6)Symbol Navigator command+2可聚焦左侧导航栏中的符号导航器。 filter0:底部编辑框输入符号(show symbols with matching name)= filter1 result+filter3 result filter1:show only class and protocol symbols (hide other global symbol types),包括project和system层次。 filter2:show only project-defined symbols,过滤显示当前工程中的符号。filter2的结果是filter1的子集,较常用。 filter3:show only containers(hide members),过滤显示包含该单词的符号。 注意:control+6只列出当前代码所在interface的符号,而Symbol Na
原文地址:https://www.cnblogs.com/zxlongblog/p/5980232.html