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

推荐订阅源

IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
ThreatConnect
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
H
Help Net Security
T
Threat Research - Cisco Blogs
Blog — PlanetScale
Blog — PlanetScale
A
Arctic Wolf
G
Google Developers Blog
量子位
U
Unit 42
I
InfoQ
V
V2EX
F
Fox-IT International blog
P
Privacy & Cybersecurity Law Blog
V
Visual Studio Blog
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
C
CERT Recently Published Vulnerability Notes
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
SecWiki News
SecWiki News
Know Your Adversary
Know Your Adversary
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
The Hacker News
The Hacker News
Project Zero
Project Zero
Application and Cybersecurity Blog
Application and Cybersecurity Blog
月光博客
月光博客
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
C
Cisco Blogs
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
Recorded Future
Recorded Future
T
Tenable Blog
W
WeLiveSecurity
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
T
The Blog of Author Tim Ferriss
www.infosecurity-magazine.com
www.infosecurity-magazine.com
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
PCI Perspectives
PCI Perspectives

崎径 其镜

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

赞助

  • 微信

    微信

  • 支付宝

    支付宝

最新文章