惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
AI
AI
B
Blog RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Threatpost
I
Intezer
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Webroot Blog
Webroot Blog
Recorded Future
Recorded Future
aimingoo的专栏
aimingoo的专栏
L
Lohrmann on Cybersecurity
Simon Willison's Weblog
Simon Willison's Weblog
MyScale Blog
MyScale Blog
Project Zero
Project Zero
L
LangChain Blog
B
Blog
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
美团技术团队
Engineering at Meta
Engineering at Meta
Cisco Talos Blog
Cisco Talos Blog
D
Docker
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
S
Security Affairs
Attack and Defense Labs
Attack and Defense Labs
N
News | PayPal Newsroom
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
V2EX - 技术
V2EX - 技术
TaoSecurity Blog
TaoSecurity Blog
博客园 - Franky
P
Proofpoint News Feed
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
The Hacker News
The Hacker News
G
GRAHAM CLULEY

崎径 其镜

Unity CVE-2025-59489 漏洞修复实践(Google Play 合规) 从零配置 VS Code C++ 环境 力扣笔记 一文详解Hexo 博客搭建 Unity 游戏的 Google Play 16 kb页面对齐处理 Unity 升级到 2022 踩坑记录(URP / 黑屏 / HTTP) Android Google Play 16 KB 页面对齐适配指南 xlua学习笔记 Lua新知 EFK日志分析系统的搭建 使用贝塞尔曲线实现道具随机飞动效果 震惊,JS不加分号会造成错误!? Linux升级Python Github图床工具 JS使用replace()函数全部替换 JS使用Splice()函数操作数组 当你的程序连接Mysql然后崩溃时 安卓应用闪屏 安卓各渠道SDK接入体验 某微信爬虫工具多开方案 U3D问题总结(七) lua U3D问题总结(六) 优化 U3D问题总结(五) 渲染与光照 U3D问题总结(四) 物理相关 U3D问题总结(三) Unity基础
iOS 应用开启包外存储访问(文件共享)
Anqi Zhao · 2026-03-24 · via 崎径 其镜

新版 Xcode 工程中,包外存储(文件共享)选项的 GUI 入口被移除,需要手动修改 Info.plist 才能开启,方便在开发测试阶段通过 Finder / iTunes 访问应用沙盒中的文件。

背景

iOS 应用默认将数据存储在沙盒中,外部无法直接访问。开启文件共享后,用户可以通过 macOS Finder 或 iTunes 直接读写应用 Documents 目录下的文件,常用于:

  • 测试阶段导出日志、存档文件
  • 验证应用写入的资源是否正确

配置方法

方法一:直接修改 Info.plist 源码

打开 Xcode 工程中的 Info.plist,右键选择 Open As → Source Code,在 <dict> 内添加以下两个键:


<key>UIFileSharingEnabled</key>
<true/>

方法二:通过 Xcode 属性编辑器添加

  1. 在 Xcode 中打开 Info.plist(默认的图形化编辑器)
  2. 点击任意行末尾的 + 按钮新增条目
  3. 搜索并选择 Application supports iTunes file sharing,值设为 YES
  4. 可选:再添加 Supports opening documents in place,值设为 YES

Unity 项目注意事项

Unity 导出 Xcode 工程时,每次导出会覆盖 Info.plist,导致手动添加的配置丢失。

推荐使用 后处理脚本自动写入,在 Editor 目录下创建脚本:

using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;

public class IOSFileSharingPostProcess
{
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget target, string path)
{
if (target != BuildTarget.iOS) return;

string plistPath = Path.Combine(path, "Info.plist");
PlistDocument plist = new PlistDocument();
plist.ReadFromFile(plistPath);

plist.root.SetBoolean("UIFileSharingEnabled", true);
plist.root.SetBoolean("LSSupportsOpeningDocumentsInPlace", true);

plist.WriteToFile(plistPath);
}
}

访问方式

开启后,通过以下方式在电脑端访问应用文件:

  • macOS Finder:连接 iPhone → 在 Finder 侧边栏选择设备 → 切换到「文件」标签 → 找到对应应用
  • iTunes(Windows):设备 → 应用 → 文件共享 → 选择应用

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 崎径 其镜

赞助

  • 微信

    微信

  • 支付宝

    支付宝