lua-protobuf 新手入门篇-第六章.编译lua-protobuf支持库(IOS插件-Mac10.13.6编译)

第一章.编译lua-protobuf支持库(Windows插件-Win10编译)
第二章.Unity & lua-protobuf 环境配置
第三章.二进制proto读取功能,与,lua-protobuf注意事项简介说明
第四章.编译lua-protobuf支持库(Android插件-Win10编译)
第五章.编译lua-protobuf支持库(Android插件-Mac10.13.6编译)
第六章.编译lua-protobuf支持库(IOS插件-Mac10.13.6编译)

介绍
本章,会用 Mac10.13.6 系统讲解

一,使用工具
1,Unity 2019.3.5f1 (64-bit)

二,开发工具下载链接
使用第五章内容

三,编译lua-protobuf需要的工具下载链接
使用第五章内容

四,终端代码出错时,解决的办法
使用第五章内容

五,查看环境变量要用的路经是否存在
使用第五章内容

六,环境变量设置
使用第五章内容

七,编译ios的.a文件
1,编译需要用XCODE,安装了XCODE的情况下,
在这里插入图片描述

adeMacBook-Pro:build a$ chmod u+x make_ios_lua53.sh
adeMacBook-Pro:build a$ make_ios_lua53.sh
CMake Error at cmake/ios.toolchain.cmake:134 (if):
  if given arguments:

    "3.6.0" "VERSION_GREATER_EQUAL" "3.14"

  Unknown arguments specified
Call Stack (most recent call first):
  /Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:95 (include)
  CMakeLists.txt:16 (project)


-- Configuring incomplete, errors occurred!
xcodebuild: error: 'XLua.xcodeproj' does not exist.
cp: build_ios/Release-iphoneos/libxlua.a: No such file or directory
adeMacBook-Pro:build a$ 

如果有,以上错误的话,说明mac os ,对应的xcode没有设对,也就是 终端找不到XCODE了。
解决办法:
1,找到xcode,我的在/Users/a/Documents/Xcode.app 这个路经下有XCODE图标,然后,要拉到,应用程序里面,才行。
2,打开终端,输入

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
adeMacBook-Pro:~ a$ cd /Users/a/Documents/Xcode.app 
adeMacBook-Pro:Xcode.app a$ sudo xcode-select -s /Users/a/Documents/Xcode.app//Contents/Developer
Password:
adeMacBook-Pro:Xcode.app a$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Password:
adeMacBook-Pro:Xcode.app a$ 

回车执行。然后,输入MAC OS系统密码,然后,要重启mac os系统才行,不然,终端认不了xcode.

3,.sh提升权限,打开终端,输入cd /Users/a/Documents/build_xlua_with_libs/build 回车
在输入 chmod u+x make_ios_lua53.sh 回车
4,/Users/a/Documents/build_xlua_with_libs/build/make_ios_lua53.sh 把这个文件,拉到终端上,回车,就可以编译了。
在这里插入图片描述
在这里插入图片描述
一分钟左右后,会生成.a文件。还有一个cpp文件没有修改日期说明不是生成的文件,这是源代码文件,打包的时候,用不上的,删除就行。

注:如果生成不了的话,要删除以下三个文件后,重新编译。
在这里插入图片描述
5,把《/Users/a/build_xlua_with_libs/build/plugin_lua53/Plugins/iOS》目录,复子覆盖到unity工程《/Users/a/Documents/lua_proto_apk_test/Assets/iOS》目录里.

八,测试编译好的一个.a文件,生成ios后到苹果手机上运行看看
1,先在mac上,UNITY运行测试。
在这里插入图片描述
苹果手机上,也能打印,以上信息,说明,.a文件生成,成功了。

2,苹果手机上,运行pkg文件,能打印以下图,就算是编译a文件成功了。
在这里插入图片描述
编译lua-protobuf完

附加功能:
如果没有苹果手机,但是想要测试.a文件,验证的话。使用以下方法。
1,在终端 nm - g “文件路径”

Last login: Sat Sep 19 18:59:50 on ttys000
-bash: export: command not found
adeMacBook-Pro:~ a$ nm -g /Users/a/Documents/build_xlua_with_libs/build/plugin_lua53/Plugins/iOS/libxlua.a 

ctype.o:
                 U ___memset_chk
                 U _cdata_mt_key
---------------- T _check_cdata
---------------- T _check_ctype
                 U _ctype_mt_key
---------------- T _ctype_size
                 U _equals_upval
                 U _luaL_error
                 U _lua_createtable
                 U _lua_getmetatable
                 U _lua_gettop
                 U _lua_getuservalue

全部保存到RTF文件里面.然后CTRL+F ,搜pb.o能搜到,说明,能用这个插件的意思
lua proto 的库就叫pb
在这里插入图片描述

第一章.编译lua-protobuf支持库(Windows插件-Win10编译)
第二章.Unity & lua-protobuf 环境配置
第三章.二进制proto读取功能,与,lua-protobuf注意事项简介说明
第四章.编译lua-protobuf支持库(Android插件-Win10编译)
第五章.编译lua-protobuf支持库(Android插件-Mac10.13.6编译)
第六章.编译lua-protobuf支持库(IOS插件-Mac10.13.6编译)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

asasj57

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值