在系统安全设置里使能administrator登陆,重启并以root登陆
3:java 环境建立
复制Android-source/jdk-1_5_0_17-linux-i586.bin 到主机linux 的home/james目录,在终端中进
入到相应目录下,分别执行以下操作:
./jdk-1_5_0_17-linux-i586.bin
修改/etc/bash.bashrc:
gedit /etc/bash.bashrc
增加以下内容:
export JAVA_HOME=/home/james/jdk1.5.0_17
export ANDROID_JAVA_HOME=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
4:cupcake 源码包的建立
复制cupcake-1.5.2.tar.bz2 到linux 的home/james 目录下
在james目录下运行tar –jvxf cupcake-1.5.2.tar.bz2
得到cupcake-1.5.2 目录
5:Android SDK 的建立
复制android-source/android-sdk-1.5.tar.bz2 到linux 的home/james 目录下tar –jvxf android-sdk-1.5.tar.bz2
得到android-sdk-1.5 目录,修改/etc/bash.bashrc:
gedit /etc/bash.bashrc
增加以下内容:
export PATH=/home/james/android-sdk-1.5/tools:$PATH
6:Eclipse 的建立
复制android-source/ eclipse-android.tar.bz2 到linux 的home/james 目录下,进入相应目录,在
终端分别进行以下操作:
tar –jvxf eclipse-android.tar.bz2
得到eclipse 目录,修改/etc/bash.bashrc:
gedit /etc/bash.bashrc
增加以下内容:
export PATH=/home/james/eclipse:$PATH
根据实际情况填写路径,保存退出
输入
source /etc/bash.bashrc
使上面的环境变量设置生效,这时候可能需要关闭当前终端并新开一个终端才能生效
7:root@:~# java -version
java version "1.5.0_17"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)
Java HotSpot(TM) Client VM (build 1.5.0_17-b04, mixed mode, sharing)
8:root@:~# emulator
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.
If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).
9:root@:~# eclipse
如果成功可以看到eclipse界面
10:Android 源码包的编译
root@:/home/james/cupcake-1.5.2# pwd
/home/james/cupcake-1.5.2
root@:/home/james/cupcake-1.5.2# make
build/core/product_config.mk:261: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
/bin/bash: bison: command not found
出错apt-get install bison
install bisom后再
root@:/home/james/cupcake-1.5.2# make
又出现如下错误
============================================
make: execvp: /bin/bash: Argument list too long
host C: acp <= build/tools/acp/acp.c
build/tools/acp/acp.c:11:20: error: stdlib.h: No such file or directory
build/tools/acp/acp.c:12:19: error: stdio.h: No such file or directory
build/tools/acp/acp.c:13:20: error: string.h: No such file or directory
build/tools/acp/acp.c:14:20: error: unistd.h: No such file or directory
build/tools/acp/acp.c:15:23: error: sys/types.h: No such file or directory
build/tools/acp/acp.c:16:22: error: sys/stat.h: No such file or directory
build/tools/acp/acp.c:17:20: error: getopt.h: No such file or directory
build/tools/acp/acp.c:18:20: error: dirent.h: No such file or directory
build/tools/acp/acp.c:19:19: error: fcntl.h: No such file or directory
build/tools/acp/acp.c:20:19: error: utime.h: No such file or directory
In file included from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/syslimits.h:7,
from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:11,
from build/tools/acp/acp.c:21:
/usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:122:61: error: limits.h: No such file or directory
build/tools/acp/acp.c:22:19: error: errno.h: No such file or directory
build/tools/acp/acp.c:23:20: error: assert.h: No such file or directory
build/tools/acp/acp.c: In function ‘process’:
build/tools/acp/acp.c:45: error: ‘NULL’ undeclared (first use in this function)
build/tools/acp/acp.c:45: error: (Each undeclared identifier is reported only once
build/tools/acp/acp.c:45: error: for each function it appears in.)
build/tools/acp/acp.c:47: error: storage size of ‘destStat’ isn’t known
build/tools/acp/acp.c:49: error: storage size of ‘sb’ isn’t known
build/tools/acp/acp.c:51: warning: implicit declaration of function ‘assert’
build/tools/acp/acp.c:61: warning: implicit declaration of function ‘strlen’
build/tools/acp/acp.c:61: warning: incompatible implicit declaration of built-in function ‘strlen’
build/tools/acp/acp.c:62: warning: implicit declaration of function ‘malloc’
build/tools/acp/acp.c:62: warning: incompatible implicit declaration of built-in function ‘malloc’
build/tools/acp/acp.c:63: warning: implicit declaration of function ‘memcpy’
build/tools/acp/acp.c:63: warning: incompatible implicit declaration of built-in function ‘memcpy’
build/tools/acp/acp.c:80: warning: implicit declaration of function ‘stat’
build/tools/acp/acp.c:82: error: ‘errno’ undeclared (first use in this function)
build/tools/acp/acp.c:82: error: ‘ENOENT’ undeclared (first use in this function)
build/tools/acp/acp.c:83: warning: implicit declaration of function ‘fprintf’
build/tools/acp/acp.c:83: warning: incompatible implicit declaration of built-in function ‘fprintf’
build/tools/acp/acp.c:83: error: ‘stderr’ undeclared (first use in this function)
build/tools/acp/acp.c:92: warning: implicit declaration of function ‘S_ISDIR’
build/tools/acp/acp.c:96: warning: incompatible implicit declaration of built-in function ‘fprintf’
build/tools/acp/acp.c:130: warning: implicit declaration of function ‘strrchr’
build/tools/acp/acp.c:130: warning: incompatible implicit declaration of built-in function ‘strrchr’
build/tools/acp/acp.c:159: warning: implicit declaration of function ‘free’
build/tools/acp/acp.c: In function ‘main’:
build/tools/acp/acp.c:184: warning: implicit declaration of function ‘getopt’
build/tools/acp/acp.c:214: warning: incompatible implicit declaration of built-in function ‘fprintf’
build/tools/acp/acp.c:214: error: ‘stderr’ undeclared (first use in this function)
build/tools/acp/acp.c:225: error: ‘optind’ undeclared (first use in this function)
build/tools/acp/acp.c:226: warning: incompatible implicit declaration of built-in function ‘fprintf’
build/tools/acp/acp.c:232: warning: incompatible implicit declaration of built-in function ‘fprintf’
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1
root@:/home/james/cupcake-1.5.2# apt-get install build-essential