博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在Linux下使用gradle自动打包
阅读量:5022 次
发布时间:2019-06-12

本文共 4437 字,大约阅读时间需要 14 分钟。

一、下载软件包

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.xml  Validate XML  Parse XML  Fetched Add-ons List successfully  Refresh Sources  Fetching URL: https://dl.google.com/android/repository/repository-11.xml  Validate XML: https://dl.google.com/android/repository/repository-11.xml  Parse XML:    https://dl.google.com/android/repository/repository-11.xml  Fetching URL: https://dl.google.com/android/repository/addon.xml  Validate XML: https://dl.google.com/android/repository/addon.xml  Parse XML:    https://dl.google.com/android/repository/addon.xml  Fetching URL: https://dl.google.com/android/repository/glass/addon.xml  Validate XML: https://dl.google.com/android/repository/glass/addon.xml  Parse XML:    https://dl.google.com/android/repository/glass/addon.xml  Fetching URL: https://dl.google.com/android/repository/extras/intel/addon.xml  Validate XML: https://dl.google.com/android/repository/extras/intel/addon.xml  Parse XML:    https://dl.google.com/android/repository/extras/intel/addon.xml  Fetching URL: https://dl.google.com/android/repository/sys-img/android/sys-img.xml  Validate XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml  Parse XML:    https://dl.google.com/android/repository/sys-img/android/sys-img.xml  Fetching URL: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml  Validate XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml  Parse XML:    https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml  Fetching URL: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml  Validate XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml  Parse XML:    https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml  Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml  Validate XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml  Parse XML:    https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xmlPackages available for installation or update: 22   1- SDK Platform Android 4.4.2, API 19, revision 4   2- SDK Platform Android 4.3.1, API 18, revision 3   3- SDK Platform Android 4.2.2, API 17, revision 3   4- SDK Platform Android 4.1.2, API 16, revision 5   5- SDK Platform Android 4.0.3, API 15, revision 5   6- Google APIs, Android API 23, revision 1   7- Google APIs, Android API 22, revision 1   8- Google APIs, Android API 21, revision 1   9- Google APIs, Android API 19, revision 20  10- Glass Development Kit Preview, Android API 19, revision 11  11- Google APIs, Android API 18, revision 4  12- Google APIs, Android API 17, revision 4  13- Google APIs, Android API 16, revision 4  14- Google APIs, Android API 15, revision 3  15- GPU Debugging tools, revision 3.1  16- GPU Debugging tools, revision 1.0.3  17- Android Auto Desktop Head Unit emulator, revision 1.1  18- Google Play APK Expansion library, revision 1  19- Google Play Licensing Library, revision 1  20- Google Play Billing Library, revision 5  21- Android Auto API Simulators, revision 1  22- Google Web Driver, revision 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/

转载于:https://www.cnblogs.com/chenpingzhao/p/5651347.html

你可能感兴趣的文章
icon fonts入门
查看>>
【Django】如何按天 小时等查询统计?
查看>>
HDU2191(多重背包)
查看>>
测试用例(一)
查看>>
【转】 mysql反引号的使用(防冲突)
查看>>
邮件中的样式问题
查看>>
AJAX 状态值与状态码详解
查看>>
php面向对象编程(oop)基础知识示例解释
查看>>
1.在数组中找到与给定总和的配对
查看>>
树的子结构
查看>>
关于根据Build Platform或者OS 加载x86或者x64 dll的问题
查看>>
程序员高效开发的几个技巧
查看>>
js-权威指南学习笔记19.2
查看>>
hexo 搭建博客
查看>>
关于 UIWebView 几个高级用法
查看>>
maven创建的项目中无法创建src/main/java 解决方案
查看>>
华为软件开发云测评报告二:代码检查
查看>>
集合1
查看>>
js 原生 ajax
查看>>
关键词 virtual
查看>>