Nexus S Flash Custom Rom

20 篇文章 0 订阅

之前一直没有时间折腾这个,最近由于要调试smali,需要源码调试,所以就。。。。
操作步骤如下:
Step1: repo 下载源码(http://source.android.com/source/downloading.html)

Step2: 下载相应的驱动(https://developers.google.com/android/nexus/drivers)
如我的需要下载6个zip包,然后解压后是相应的6个sh文件,复制到下载的源码根目录,并运行这些shell文件,会在生成一个vendor 驱动文件夹。

Step3: 初始化环境
$ source build/envsetup.sh


$ . build/envsetup.sh

Step4: 选择target 
运行
lunch

PS:至于你怎么选其实可以参照(http://source.android.com/source/building-devices.html)
Nexus S 选择的是crespo。

Step5: 刷机 参照(http://source.android.com/source/building-devices.html)

主要是说下, google给的刷机的简单命令就是 fastboot -w flashall
在控制台下面直接运行fastboot, 可以看到相应的fastboot的参数命令如下:
usage: fastboot [ <option> ] <command>

commands:
  update <filename>                        reflash device from update.zip
  flashall                                 flash boot + recovery + system
  flash <partition> [ <filename> ]         write a file to a flash partition
  erase <partition>                        erase a flash partition
  format <partition>                       format a flash partition 
  getvar <variable>                        display a bootloader variable
  boot <kernel> [ <ramdisk> ]              download and boot kernel
  flash:raw boot <kernel> [ <ramdisk> ]    create bootimage and flash it
  devices                                  list all connected devices
  continue                                 continue with autoboot
  reboot                                   reboot device normally
  reboot-bootloader                        reboot device into bootloader
  help                                     show this help message


options:
  -w                                       erase userdata and cache (and format
                                           if supported by partition type)
  -u                                       do not first erase partition before
                                           formatting
  -s <specific device>                     specify device serial number
                                           or path to device port
  -l                                       with "devices", lists device paths
  -p <product>                             specify product name
  -c <cmdline>                             override kernel commandline
  -i <vendor id>                           specify a custom USB vendor id
  -b <base_addr>                           specify a custom kernel base address. default: 0x10000000
  -n <page size>                           specify the nand page size. default: 2048
  -S <size>[K|M|G]                         automatically sparse files greater than
                                           size.  0 to disable

也就是说flashall 参数,把手机的boot, recovery, system 一起给刷进系统中,而-w参数 清除了手机userdata和cache的数据,明白了这个后,我顿时就犯贱了下, 写了下面的脚本,一个个慢慢刷进去系统中。
如下:
#!/bin/sh


fastboot devices


fastboot flash userdata userdata.img
fastboot reboot-bootloader
sleep 5


fastboot flash boot boot.img
fastboot reboot-bootloader
sleep 5


fastboot erase recovery
fastboot flash recovery recovery.img
fastboot reboot-bootloader
sleep 5


fastboot flash system system.img

参考:
http://source.android.com/source/building-devices.html
http://blog.csdn.net/june5253/article/details/8560557

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值