1. 编译源码命令 :linux进入android源码目录,终端输入: make -j4
   353  . build/envsetup.sh 
   354  choosecombo 4 f12nad eng
   355  make clean
   356  make -j8 update-api 2>&1 | tee update-api.log 
   357  make -k -j12 2>&1 | tee build.log 
2. 编译某个目录下的源码:
linux进入android源码目录,终端输入: source build/envsetup.sh , 回车
然后输入:mmm XXX目录路径。
比如编译联系人:
 mmm packages/apps/Contacts/
 编完之后生成两个文件:
 out/target/product/generic/data/app/ContactsTests.apk
 out/target/product/generic/system/app/ Contacts.apk
  编译出来的APK,但APK并不包含在system文件夹中,我们可以使用make snod 打包system文件夹,产生新的system.img。 
 
  3. 对模拟器操作system下面的文件,用cmd,里面输入:adb remount。 这样就可以操作了。 
 
  4. 重新设置linux的root密码命令: sudo passwd root 
 
5. 设置ubuntu的软件源(网易的,速度比较快)
deb http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted
                                                    
                                            5. 设置ubuntu的软件源(网易的,速度比较快)
deb http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted
来源:oschina
链接:https://my.oschina.net/u/195456/blog/66657