1、配置eclipse环境:首先在官网下载安装包: http://developer.android.com/sdk/index.html ,点击这个按钮开始下载
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_4ffd3540da68054.png)
进入下一页,选择对应你系统的版本,继续下载。
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_b64b94dc5e4cc85.png)
32和64位版本千万不能选错了,如果不清楚就查看一下你的系统版本。
![点击查看原图](http://game.ceeger.com/forum/attachment/thumb/1401/thread/27_1_b8bac3f1479be5c.png)
下载完成后就是类似这样的包adt-bundle-windows-x86_64-20131030.zip,解压出来像这样
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_5cb0e2349f55b5f.png)
为了方便我们把它们让入adt文件夹,移动到C盘根目录,当然你也可以放到其他目录。
2、配置java环境:打开eclipse文件中的eclipse.exe文件会提示
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_3471d561e3fd285.png)
这是缺少JRE运行环境,下面我们来下载安装它
打开java官网 http://www.java.com/zh_CN/download/ ,点击左侧的“所以Java下载”链接。
![点击查看原图](http://game.ceeger.com/forum/attachment/thumb/1401/thread/27_1_bb5cd228fb9f90b.png)
然后选择Windows 64位版本下载
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_6861ce170b2f649.png)
下载完成后
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_4b02fe289dcd9c8.png)
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_d615038dbecaa7b.png)
为了便于管理我们也把它放入adt文件夹中
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_35ed78b0da6235f.png)
3、配置android SDK:这时候打开eclipse.exe就可以启动了,首先弹出的是开发的项目目录,你可以自定义的随便啦,
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_bee331cb32d2999.png)
4、为了更新SDK需要修改系统Hosts文件,如果你使用代理上网,这步可以跳过。
在这个目录C:\Windows\System32\drivers\etc找到hosts文件,拖到桌面
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_d69128afd760ec1.png)
右键打开方式选择记事本,在最下面添加下面一行并保存,然后把hosts再拖回去。注意这个IP是有时效的,不能用的话就到网上搜一个。
203.208.46.146 dl-ssl.google.com
然后进行下面的设置。
![点击查看原图](http://game.ceeger.com/forum/attachment/thumb/1401/thread/27_1_3f78de9e3ccac4c.png)
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_7fe68e2b914c689.png)
5、更新Angdroid SDK:
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_b1693f52b43f640.png)
打开Android SDK管理器窗口,选择各版本更新,开始下载。
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_0953d313370f191.png)
这边全部变成对号才会安装。
![点击查看原图](http://game.ceeger.com/forum/attachment/thumb/1401/thread/27_1_3e8c4b1ed10fa4e.png)
6、设置Unity Android SDK目录:打开Unity Edit -> Preferences...浏览Andoid SDK的目录,也就是我们之前自定义的C:\adt\sdk目录
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_d9da0dc8718d1aa.png)
接下来我们进行Unity发布测试,打开File -> Build Setting编译设置对话框,选中Android图标,点击Switch Platform按钮,这样就可以切换到android发布平台了。连上手机,然后点击Build And Run来发布试试看。
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_2652b4acd1ea159.png)
但是没有如愿,提示这样
,提示是JDK没有安装,但是我们已经安装了呀,下面解决问题。
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_48ad0e14cb6e202.png)
7、设置环境变量:
![点击查看原图](http://game.ceeger.com/forum/attachment/thumb/1401/thread/27_1_625ad4dfa2bf7fc.png)
这样就可以了,为了方便输入eclipse命令也可以把C:\adt\sdk\platform-tools\;C:\adt\sdk\tools\;添加到Path。
8、检查eclipse的设置是否成功,打开命令提示行,先CD C:\adt\sdk\platform-tools进入目录,再输入adb nodaemon server,
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_78ef2d1917341a9.png)
发现adb的5037端口绑定失败了,再用netstat -ano | findstr "5037"查找端口被谁占用了,原来是1884进程,一般会是QQ或是其他的手机管理程序,主要每个人查找出的结果是不一样的。
打开任务管理器,
把PID显示出来,找到1884那就结束任务,记得要先关闭QQ和其他手机工具的所有软件,如果没有找到,那就重启电脑,记得不要先启动QQ和其他手机工具。当然也可以tasklist | findstr "1884",快速找到占用的程序。
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_8abe8965c9f84db.png)
把PID显示出来,找到1884那就结束任务,记得要先关闭QQ和其他手机工具的所有软件,如果没有找到,那就重启电脑,记得不要先启动QQ和其他手机工具。当然也可以tasklist | findstr "1884",快速找到占用的程序。
然后,在命令行输入adb start-server
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_4044e5d575e37e0.png)
8、这个提示
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_10f8771d79652e3.png)
9、如果最后编译出现的仍然是这个提示
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_457518709c68c88.png)
那么打开“设备管理器”,如果有这样的条目
![点击查看原图](http://game.ceeger.com/forum/attachment/1401/thread/27_1_20260fcfda186af.png)