ubuntu下Android源代码模块编译

来自:http://zlb1986.javaeye.com/blog/767363

 

 

ubuntu下Android源代码模块编译


1.下载Android源代码的过程就不说了,网上资料一大把 
2.安装jdk1.5的步骤就不说了,网上资料一大把 
3.下载源代码我放置的目录是/home/wuyutaott/android 
4.进入android命令行中输入make进行编译,漫长的等待,需要半天时间 
5.配置环境 
  gedit .bashrc  注意路径,我是在home/wuyutaott/下进行的 

  将一下2行添加到文件末尾: 

  export PATH=$PATH:/home/xxx/android/out/host/linux-x86/bin 

  export ANDROID_PRODUCT_OUT=/home/xxx/android/out/target/product/generic 
6.启动模拟器,一直都不用管,要不然重新启动很浪费时间 
  emulator 
7.选择一个项目进行修改,这里我选择的是Launcher,修改其源代码 
8.进行模块编译 
  mmm packages/apps/Launcher  注意路径,我是在home/wuyutaott/android下进行的 
  如果提示没有找到mmm命令 
  执行. build/envsetup.sh  source build/envsetup.sh (应 用 修改 ) 
8.编译过之后 
  /home/wuyutaott/android/out/target/product/generic/system/app/Launcher.apk这个文件会更新 
  查看其属性会看到他的更新时间就是你刚才模块编译的时间 
9.下一步需要把更新之后的Launcher.apk安装到模拟器上 
  adb install -r /home/wuyutaott/android/out/target/product/generic/system/app/Launcher.apk 
  模拟器会暗屏一下,然后再亮起来,说明它自己重新启动了,但是速度很快 
  OK可以看到修改之后的效果了 
10.我以前的做法是模块编译之后,$make snod重新生成system.img(非常浪费时间)。然后把模拟器关掉重新启动(非常浪费时间),现在改进了之后速度快了不少。 
11.下一步重点的就是想办法在ubuntu上吧eclipse配置好,好进行调试,和编译代码,要不然在.java文件中直接改代码也是一件痛苦的事情,但是ubuntu下配置eclipse进行Android源代码开发我还不会,比较麻烦,有兴趣的朋友可以参考http://wangzi6hao.javaeye.com/blog/531603

 

fastboot android10版本 ubuntu linux平台 fastboot version 28.0.2-PD02.200305.0422 $ fastboot -h usage: fastboot [OPTION...] COMMAND... flashing: update ZIP Flash all partitions from an update.zip package. flashall Flash all partitions from $ANDROID_PRODUCT_OUT. On A/B devices, flashed slot is set as active. Secondary images may be flashed to inactive slot. flash PARTITION [FILENAME] Flash given partition, using the image from $ANDROID_PRODUCT_OUT if no filename is given. basics: devices [-l] List devices in bootloader (-l: with device paths). getvar NAME Display given bootloader variable. reboot [bootloader] Reboot device. locking/unlocking: flashing lock|unlock Lock/unlock partitions for flashing flashing lock_critical|unlock_critical Lock/unlock 'critical' bootloader partitions. flashing get_unlock_ability Check whether unlocking is allowed (1) or not(0). advanced: erase PARTITION Erase a flash partition. format[:FS_TYPE[:SIZE]] PARTITION Format a flash partition. set_active SLOT Set the active slot. oem [COMMAND...] Execute OEM-specific command. gsi wipe|disable Wipe or disable a GSI installation (fastbootd only). boot image: boot KERNEL [RAMDISK [SECOND]] Download and boot kernel from RAM. flash:raw PARTITION KERNEL [RAMDISK [SECOND]] Create boot image and flash it. --dtb DTB Specify path to DTB for boot image header version 2. --cmdline CMDLINE Override kernel command line. --base ADDRESS Set kernel base address (default: 0x10000000). --kernel-offset Set kernel offset (default: 0x00008000). --ramdisk-offset Set ramdisk offset (default: 0x01000000)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值