Android在Linux下使用edl脚本刷机

下载编译好的源码,并更改源码的权限:

chmod -R 777 . 

用USB连接手机,手机是正常的开机状态就好,执行刷机命令:

adb root  #进入root模式
adb remount  #挂在
./edl-flash.sh

注意:如果不执行sudo,会报错:

13:16:30: INFO: FH_LOADER WAS CALLED EXACTLY LIKE THIS
************************************************
./apps/fh_loader --port=/dev/ttyUSB0 --noprompt --showpercentagecomplete --zlpawarehost=0 --memoryname=UFS --setactivepartition=1 --reset 
************************************************

13:16:30: INFO: Current working dir (cwd): 
13:16:30: INFO: Showing network mappings to allow debugging
13:16:30: INFO: jathefo: memoryname UFS

13:16:30: INFO: User wants to talk to port '/dev/ttyUSB0'


     _____                    
    |  ___|                   
    | |__ _ __ _ __ ___  _ __ 
    |  __| '__| '__/ _ \| '__|
    | |__| |  | | | (_) | |   
    \____/_|  |_|  \___/|_|  


13:16:30: {ERROR: Could not open '/dev/ttyUSB0'}

主要错误在于:{ERROR: Could not open '/dev/ttyUSB0'}
解决方法:
1:执行刷机命令的时候,前面添加sudo

sudo ./edl-flash.sh

PS:不能第一次直接执行sudo ./edl-flash.sh 需要等报错之后前面才能加sudo。

2:https://lists.linuxfoundation.org/pipermail/fuego/2017-April/000382.html

To do this once, you can, as root, on the host, do:
 $ chmod a+rw /dev/ttyUSB0
or (same thing, but with numbers):
 $ chmod 0666 /dev/ttyUSB0

你可能感兴趣的:(Android在Linux下使用edl脚本刷机)