你的位置:首页 > 操作系统

[操作系统]在Linux下使用gradle自动打包

一、下载软件包

1、下载地址

wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgzwget http://services.gradle.org/distributions/gradle-2.12-bin.zip

二、安装

1、java

sudo add-apt-repository ppa:openjdk-r/ppasudo apt-get updatesudo apt-get install openjdk-8-jdksudo update-alternatives --config javasudo update-alternatives --config javac

2、Android sdk

./android list sdk

查看源

Refresh Sources: Fetching https://dl.google.com/android/repository/addons_list-2.

根据需要进行安装

./android update sdk --no-ui --filter 1,31,tool,platform-tool

如果google很慢,可以改hosts  

74.125.237.1 dl-ssl.google.com

3、gradle 

加入环境变量

export PATH=/mnt/javasrc/gradle-2.12/bin:/mnt/javasrc/android-sdk-linux:$PATH

三、编译测试

gradle assReleasegradle clean

  

参考网址

http://askubuntu.com/questions/464755/how-to-install-openjdk-8-on-14-04-lts

https://developer.android.com/studio/index.html#downloads

http://blog.csdn.net/catoop/article/details/7618099

http://ftp.gnu.org/gnu/glibc/

http://my.oschina.net/zhangxu0512/blog/262275

http://www.cnblogs.com/killkill/archive/2010/08/23/1806468.html

http://openjdk.java.net/install/

https://www.unixmen.com/install-oracle-java-jdk-8-centos-76-56-4/

http://stackoverflow.com/questions/31182240/what-exactly-is-tools-jar-in-the-android-sdk

http://tecadmin.net/install-oracle-java-8-jdk-8-ubuntu-via-ppa/