您的位置:首页 > 移动开发 > Unity3D

Unity3D安卓导出包加密学习----编译mono

2016-04-19 19:47 603 查看
环境:

Mac OS X10.10.5

Unity3D版本4.6.9f1

下载

mono-unity-4.6

https://github.com/Unity-Technologies/mono/tree/unity-4.6

android-ndk-r9

https://dl.google.com/android/ndk/android-ndk-r9-darwin-x86.tar.bz2

android-ndk-r10e

http://pan.baidu.com/s/1jI6Mfv4

(解压r10e方法:

chmod a+x android-ndk-r10e-darwin-x86_64.bin

./android-ndk-r10e-darwin-x86_64.bin



网上介绍的文章都是ubuntu的系统,可以使用sudo apt-get install xxxx安装编译依赖的工具

Mac下我用的是brew代替:

curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1

sudo brew install automake autoconf libtool pkg-config

(PS:gcc、make、也可能需要,但是mac下已经有了就不重复安装了)

参考:http://www.cnblogs.com/liulipeng/p/3938518.html

安装命令如下:

curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1

当brew安装成功后,就可以随意安装自己想要的软件了,例如wget,命令如下:

sudo brew install wget  

卸载的话,命令如下:

sudo brew uninstall wget

查看安装软件的话,命令如下:

sudo brew search /apache*/

注意/apache*/是使用的正则表达式,用/分割。

环境搭好了,开始编译Mono

命令行切换到mono根目录,执行

./external/buildscripts/build_runtime_android.sh

顺利的话直接坐等刷屏,然后Build Success

我掉了2个坑,

一个是build脚本指定了ndk-r10e,但是里面的其他地方又用到了r9,所以两个包都得下。

另一个是编译时死活不认glibtoolize,需要重新Link一下。参考:http://apple.stackexchange.com/questions/108513/cant-exec-glibtoolize-no-such-file-or-directory

link第一次失败,根据提示强制link

 sudo brew link --overwrite libtool 

参考:

http://www.tuicool.com/articles/7fMVbqu

http://www.cppcourse.com/u3d-encryption.html

http://www.narkii.com/club/thread-330884-1.html

http://blog.csdn.net/u011643833/article/details/47261015

http://www.xuanyusong.com/archives/3553

http://www.xuanyusong.com/archives/3571
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: