c++ - iOS 上的 DLL(dylib) 热重载
问题描述
我正在 iOS 设备上测试 dylib 热重载。(这里有一些关于 dll 热重载的好读物。https://ourmachinery.com/post/dll-hot-reloading-in-theory-and-practice/)
它在模拟器上运行良好,因为我可以将 dylib 上传到应用程序的文档目录并 dlopen() 它。
std::string soPath = docPath + "/test.dylib";
auto h = dlopen( soPath.c_str(), RTLD_NOW );
但显然,自 iOS 10 以来,这在设备上是被禁止的。
iOS 10 沙盒中的 dlopen() 被阻止 https://gist.github.com/jonbro/0638a2056e134bc26498
dlopen() 返回 NULL 并且 dlerror() 给我与上述链接相同的错误。
文件系统沙箱阻止了“...”的 mmap()
在 Android 上,它也拒绝在“外部存储”中 dlopen() .so 文件,但在“内部存储”中是允许的。有了应用程序的文件写入权限,我想我可以使用本地文件服务器自动执行该过程。
iOS 上是否有这种类型的存储/目录,我可以在其中上传 dylib 文件和 dlopen() 它?或者任何一种解决方法?
我宁愿不越狱。
谢谢。
解决方案
推荐阅读
- java - java openjdk版本“1.8.0_292”的SSL错误
- azure-devops - azure-spring-boot-starter-keyvault-secrets 在 PCF 中的应用程序启动期间未解析 vcap 服务变量
- sql - group by 根据标题返回总共三列
- oracle - oracle中某些列的选择
- ratpack - 兼容的 Groovy 版本
- sql - 计算出现次数和出现次数的百分比
- vue.js - 从 vue.js 3 中传递数据的方法渲染组件
- vega - Vega:使画布适合容器宽度
- java - 如何使用 Apache POI 取消合并特定行中的单元格?
- python - Django rest 框架:序列化程序在响应数据中不包含 id 字段