2019独角兽企业重金招聘Python工程师标准>>>
相关资源下载:
http://www.cnblogs.com/bjzhanghao/archive/2012/11/14/android-platform-sdk-download-mirror.html
官方链接:http://developer.android.com/sdk/index.html
一、安装java
这个就不谈了。
最新的jdk在此下载:http://www.oracle.com/technetwork/java/javase/downloads/index.html
1.7版本的:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
安装完了
配置JAVA_HOME 添加$JAVA_HOME/bin/到系统$PATH
可以参考这个
echo 'export JAVA_HOME=/usr/java/jdk1.7.0_25 #替换自己的java版本
export PATH="$JAVA_HOME/bin/:$PATH"'>>/etc/profile
二、下载配置ant
官方地址:http://ant.apache.org/
下载地址:http://ant.apache.org/bindownload.cgi
对应的版本,本文需要的是
wget "http://mirrors.cnnic.cn/apache//ant/binaries/apache-ant-1.9.4-bin.zip"
tar -zxvf apache-ant-1.9.4-bin.tar.gz -C /opt/
echo -e '''export ANT_HOME="/opt/apache-ant-1.9.4" \nexport PATH="$ANT_HOME/bin:$PATH"'''>>/etc/profile
ant -version
三、下载配置android sdk
下载地址:
http://www.cnblogs.com/bjzhanghao/archive/2012/11/14/android-platform-sdk-download-mirror.htmlecho -e '''export ANDROID_HOME="/root/work/android-sdk-linux" \nexport PATH="$ANDROID_HOME/tools:$PATH"'''>>/etc/profile
#配置好的目录。
[root@slave2 android-sdk-linux]# cd /opt;tree android-sdk-linux -L 2
android-sdk-linux
├── add-ons
├── build-tools
│ ├── android-4.3.1
│ ├── android-4.4.2
│ ├── build-tools_r18.1.1-linux.zip
│ └── build-tools_r19.1-linux.zip
├── platforms
│ ├── android-18_r02.zip
│ ├── android-2.2_r03-linux
│ └── android-4.3
├── platform-tools
│ ├── adb
│ ├── api
│ ├── fastboot
│ ├── NOTICE.txt
│ ├── source.properties
│ └── systrace
├── SDK Readme.txt
└── tools
├── android
├── ant
├── apps
├── ddms
├── draw9patch
├── emulator
├── emulator64-arm
├── emulator64-mips
├── emulator64-x86
├── emulator-arm
├── emulator-mips
├── emulator-x86
├── hierarchyviewer
├── jobb
├── lib
├── lint
├── mksdcard
├── monitor
├── monkeyrunner
├── NOTICE.txt
├── proguard
├── screenshot2
├── source.properties
├── support
├── templates
├── traceview
└── uiautomatorviewer
17 directories, 29 files
四、到已经开发好的项目目录下
[root@slave2 HelloWorld]# android update project -h
Error: Flag '-h' is not valid for 'update project'.
Usage:
android [global options] update project [action options]
Global options:
-h --help : Help on a specific command.
-v --verbose : Verbose mode, shows errors, warnings and all messages.
--clear-cache: Clear the SDK Manager repository manifest cache.
-s --silent : Silent mode, shows errors only.
Action "update project":
Updates an Android project (must already have an AndroidManifest.xml).
Options:
-l --library : Directory of an Android library to add, relative to this
project's directory.
-p --path : The project's directory. [required]
-n --name : Project name.
-t --target : Target ID to set for the project.
#-t参数可以通过android list target查看。
-s --subprojects: Also updates any projects in sub-folders, such as test
projects.
android update project -p HelloWorld -t 1 #用于生成或更新build.xml
#android create project -t 1 -p HelloWorld #用于新建android工程
五、异常处理
关于.so的报错使用:
yum whatprovides ld-linux.so.2
然后安装相应的包