[置顶] Android系统安全之旅 第1章 运行编译过的Android系统

运行Android虚拟机步骤


1、运行emulator部署前配置


1)用sudo vim /etc/environment配置


PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export JAVA_HOME=/home/strom/android/jdk1.6.0_45
export JRE_HOME=/home/strom/android/jdk1.6.0_45/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export ANDROID_PATH=/home/strom/android/Android4.4/out/host/linux-x86
export ANDROID_PRODUCT_OUT=/home/strom/android/Android4.4/out/target/product/generic
export ANDROID_SWT=/home/strom/android/Android4.4/out/host/linux-x86/framework


2)用sudo vim /etc/profile配置


export JAVA_HOME=/home/strom/android/jdk1.6.0_45
export JRE_HOME=/home/strom/android/jdk1.6.0_45/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export ANDROID_PATH=/home/strom/android/Android4.4/out/host/linux-x86
export ANDROID_PRODUCT_OUT=/home/strom/android/Android4.4/out/target/product/generic
export ANDROID_SWT=/home/strom/android/Android4.4/out/host/linux-x86/framework
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$ANDROID_PATH/bin:$PATH:$HOME/bin


3)注销用户重新登录配置生效


2、执行emulator命令启动andriod


如果重启系统后:
执行emulator,出现如下错误:
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android SDK user, please use '@<name>' or '-avd <name>'
to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator


解决:
source build/envsetup.sh (build是android源码的目录)
lunch sdk-eng


然后再执行emulator命令就可以启动模拟器



你可能感兴趣的:([置顶] Android系统安全之旅 第1章 运行编译过的Android系统)