当前位置: 首页 > news >正文

macOS挂载iOS应用沙盒文件夹

背景

工具

  • libimobiledevice: linux,macOS等与ios设备通信是的工具

  • macFUSE 是 macOS 文件系统扩展的“引擎”,支持开发者创建各类虚拟文件系统。

  • iFUSE 是专为 iOS 设备设计的“连接器”,需依赖 macFUSE 实现功能。

若需访问 iPhone/iPad 文件,必须同时安装两者;若仅需挂载网络存储或开发自定义文件系统,则只需 macFUSE。

安装

brew install libimobiledevicebrew install --cask macfusesudo ln -s /Library/Filesystems/macfuse.fs/Contents/Resources/mount_macfuse /usr/local/bin/
sudo ln -s /Library/Filesystems/macfuse.fs/Contents/Resources/load_macfuse /usr/local/bin/
sudo ln -s /Library/Filesystems/macfuse.fs/Contents/Resources/macfuse_stat /usr/local/bin/brew install ifuse 
# 或者
# 1. 添加第三方仓库
brew tap gromgit/fuse# 2. 直接安装适配版 ifuse
brew install gromgit/fuse/ifuse-mac  # 注意使用 `-mac` 后缀# 3. 验证版本
ifuse --version  # 通常为最新稳定版(如 1.1.4+)

安装过程遇到依赖没有就安装相应的依赖,网络原因下载不了?
配置~/.bash_profile, source

brew install gromgit/fuse/ifuse-mac
lockf: 200: already locked
Error: Another `brew update` process is already running.
Please wait for it to finish or terminate it to continue.
==> Downloading https://ghcr.io/v2/gromgit/fuse/ifuse-mac/manifests/1.1.4-1
######################################################################################################################################################################################################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/formula.jws.jsonWarning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
Warning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
Warning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
Warning: formula.jws.json: update failed, falling back to cached version.
Error: Cannot download non-corrupt https://formulae.brew.sh/api/formula.jws.json!
export BASH_SILENCE_DEPRECATION_WARNING=1
export PATH=$PATH:/opt/homebrew/bin:/Users/jenkinsuser/workspace/envexport HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
# brew4.x API加速
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
# hide
export HOMEBREW_NO_ENV_HINTS="1"#
export HOMEBREW_NO_INSTALL_FROM_API=1

版本不匹配?推荐版本搭配

组件推荐版本安装来源
macFUSE4.10.2brew install --cask macfuse
ifuse≥1.1.4gromgit/fuse Tap(首选)或修改公式安装

macfuse 内核拓展安装不上?

  1. 重启进入revover模式,安全选项,中开启允许安装第三方的内核拓展程序。
  2. 重启,执行load_macfuse 加载内核拓展,在设置,安全与隐私中找到
    macfuse内核拓展安装的安装事件。允许,即可。

使用

前置条件

  1. 设备要求:
  • iOS 设备已通过 USB 连接到 Mac
  • 设备已信任当前电脑(解锁设备后出现的提示中选择"信任")
  • 设备已开启文件共享(仅能访问已启用文件共享的应用)
  1. 应用要求:
  • 应用必须明确启用文件共享(在 Info.plist 中添加 UIFileSharingEnabled=true)
  • 开发者应用需要有效的签名描述文件

查找bundle id

  1. 使用ideviceinstaller
# 安装工具
brew install ideviceinstaller
# 列出所有应用
ideviceinstaller -l

或者iosdeploy,cfgutil等

挂载应用的路径

  1. 挂载命令
# 基本命令格式
ifuse <挂载点目录> \--bundle-id <应用的Bundle ID> \[--documents | --container]
选项作用
–documents挂载应用的 Documents 目录
–container挂载整个应用沙盒容器(需要开发者签名)
–root挂载整个设备文件系统(仅限越狱设备)
# 创建挂载点
mkdir ~/myapp_documents# 挂载应用的 Documents 目录
ifuse ~/myapp_documents --bundle-id com.mycompany.MyApp --documents# 挂载整个沙盒容器(需要开发者证书)
mkdir ~/myapp_container
ifuse ~/myapp_container --bundle-id com.mycompany.MyApp --container

访问

应用沙盒文件夹tree如下:

├── Documents/        # 用户文档(通过 --documents 挂载)
├── Library/
│   ├── Preferences/  # 应用偏好设置 (.plist)
│   └── Caches/       # 缓存文件
├── tmp/              # 临时文件
└── .com.apple.mobile_container_manager.metadata.plist  # 容器元数据

卸载路径

# 卸载指定挂载点
umount ~/myapp_documents# 强制卸载(如果普通卸载失败)
fusermount -u ~/myapp_documents
http://www.dtcms.com/a/264785.html

相关文章:

  • 飞算 JavaAI 智控引擎:全链路开发自动化新图景
  • 【字节跳动】数据挖掘面试题0003:有一个文件,每一行是一个数字,如何用 MapReduce 进行排序和求每个用户每个页面停留时间
  • 橡胶硬度计在不同领域中的应用
  • mybatis考试
  • 无人机一机多控技术的核心要点
  • 亿级物联网MQTT集群:OpenResty深度优化实践
  • Docker for Windows 设置国内镜像源教程
  • 基于spark的航班价格分析预测及可视化
  • v3 中的storeToRefs
  • AWS WebRTC:根据viewer端拉流日志推算视频帧率和音频帧率
  • uniapp实现图片预览,懒加载
  • 数据分类分级系统的建设思路
  • Rust 安装使用教程
  • 【已解决】执行conda init提示No action taken.
  • 客服机器人知识库怎么搭?智能客服机器人3种方案深度对比(含零售落地案例)
  • 部署KVM 虚拟化平台
  • AI驱动,治理升级!数造科技亮相中博会,打造一站式数据开发治理新范式
  • OFA-PT:统一多模态预训练模型的Prompt微调
  • 暴力破解漏洞与命令执行漏洞
  • PHP 命令行工具的常用选项详解
  • 图像二值化方法及 Python OpenCV 实现
  • 深度剖析NumPy核心函数reshape()
  • 香港券商交易系统开发与解决方案全景报告:云原生、跨境协同与高性能架构的创新实践
  • qt-- 学习笔记11(mingw编译,windeployqt生成执行文件exe,同一exe文件不同文件夹结果不同)
  • 分布式定时任务:Elastic-Job-Lite
  • P3842 [TJOI2007] 线段(动态规划)
  • RAC (ReactiveCocoa) 的实现机制与消息传递策略
  • XILINX Kintex 7系列FPGA的架构
  • ubentu服务器版本安装Dify
  • 【leetcode算法300】:哈希板块