如何编译支持osx的libleaf.a? #157
-
|
查看 libleaf-ios % lipo -info libleaf.a 如何编译出支持支持Mac 的lib? |
Beta Was this translation helpful? Give feedback.
Replies: 25 comments 17 replies
-
|
make lib 即可 https://github.com/eycorsican/leaf/blob/master/Makefile#L9 |
Beta Was this translation helpful? Give feedback.
-
|
tks |
Beta Was this translation helpful? Give feedback.
-
|
@cielpy 能正常编译 iOS的规则 Mac 没办法用,就是不能正常使用,不知道是不是规则路径的原因? osx ASSET_LOCATION 能用不?相对路径,绝对路径都不行? |
Beta Was this translation helpful? Give feedback.
-
ASSET_LOCATION 可以用,#115 |
Beta Was this translation helpful? Give feedback.
-
|
ASSET_LOCATION 写配置信息里面吗?我各种尝试都不行 |
Beta Was this translation helpful? Give feedback.
-
声明一个环境变量 #115 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
不知道这个环境变量设置哪里路径比较合理,尝试归档,group ,本地静态路径都不行,要不就是没得权限,链接成功后,代理没成功. |
Beta Was this translation helpful? Give feedback.
-
|
用leaf_test_config 测试相对路径规则 返回的是的是0,在传给leaf_run,如果设置tun-fd 等于具体某一个值,直接挂了,好像也是返回0,如果不设置这个值,不出现问题,但是代理没法用,应该不是路径问题? |
Beta Was this translation helpful? Give feedback.
-
|
如果你用 Swift,调用 然后把资源文件放到 /Users/xxx/xxx/ 下就可以了 添加一条规则 启动 leaf 日志里会有显示加载成功 正常情况下,整个流程就是这样的了 |
Beta Was this translation helpful? Give feedback.
-
|
不行 已经测试过了,我猜你用的是单机版 |
Beta Was this translation helpful? Give feedback.
-
|
我实测,是可以的 |
Beta Was this translation helpful? Give feedback.
-
你用的是NE吗? |
Beta Was this translation helpful? Give feedback.
-
什么是单机版? 我没有用 NE,直接调用 leaf_run 运行的 用 NE leaf 应该是运行在另一个进程吧,setenv 应该是作用于当前进程 |
Beta Was this translation helpful? Give feedback.
-
明白了 单机版是指那种不用通过苹果商店奋发的 |
Beta Was this translation helpful? Give feedback.
-
刚才测试了一下是这样的,用NE的话,设置本地路径 没得权限的,还发现一个问题,传入配置文件的路径中如果含有空格,传入leaf_run 会导致没办法找到相应的路径的,不知道这位开源大神有没有遇到过 |
Beta Was this translation helpful? Give feedback.
-
我没有搞过 NE 的开发,猜测 NE 应该是一个受限的沙盒进程,所以不能访问本地路径吧 没有遇到过,macOS 的路径有空格时需要处理吧,个人是尽量避免路径有空格的,所以没遇到 |
Beta Was this translation helpful? Give feedback.
-
|
start with options: 有遇到这种问题没,用NE 用到tun-fd 就挂了 |
Beta Was this translation helpful? Give feedback.
-
@wangjinwei0806 没有权限,日志里说的很清楚了 |
Beta Was this translation helpful? Give feedback.
-
我知道是没得权限,但是leaflib 这个框架怎么给权限,这个需要如何操作,报错这个不是用的NE,按照你上面描述的设置setenv 环境变量,后面直接出现上面这个错误了,是不是使用方式不对,“loaded 629 domain rules ”有这些日志了,説名路径正常 |
Beta Was this translation helpful? Give feedback.
-
这个需要你自己结合 NE 文档查了,我并不清楚,抱歉 |
Beta Was this translation helpful? Give feedback.
-
|
上面的没用NE,你在运行lib的时候有遇到以下日志吗? |
Beta Was this translation helpful? Give feedback.
-
Xcode scheme 里,调整成用root用户运行 |
Beta Was this translation helpful? Give feedback.
-
|
start with options: "Resource busy" 资源被占用,我重启电脑还是这样 |
Beta Was this translation helpful? Give feedback.
-
|
是不是有另一个 leaf 进程在跑而且用的相同的配置文件?资源有竞争了? |
Beta Was this translation helpful? Give feedback.
-
|
提供一下完整调用代码和 配置 |
Beta Was this translation helpful? Give feedback.



最后所需的代码也已经补上了:eycorsican/rust-tun@1ada024
编译可能要 cargo update 一下
NE 框架,跟 iOS 的应该没什么区别