要想在Android手机上面烧录自己生成的Img文件,必须要先解锁手机的bootloader,下面是整理的 Google Pixel手机(Pixel XL)的解锁bootloader的步骤。
1. 删除手机上面的google账号: Settings -> Users&Accounts -> Remove Accounts
2. 删除手机上所有的指纹锁,密码锁或者图案锁
3. 拔出手机上的Sim卡
4. 回复出厂设置: adb reboot bootloader -> recovery mode -> 音量+(点击),按住power,音量+(点击)-> factory reset
5. 重新开机,跳过所有设置,不要连接wifi,不要设置任何指纹锁和密码锁
6. 对于上面的步骤,如果无法跳过wifi连接等设置,此时可以紧接着在一次进行回复出厂设置(同时按住power 和 音量 -)
7. 打开usb调试
8. 连接adb运行下面的命令
adb shell pm uninstall --user 0 com.android.phone
9. 重启设备,连接wifi,打开chrome登陆google.com(或者其他任何网站)
10. 进入开发者选项,打开 OEM unlocking 选项,如果此时 OEM unlocking 选项为灰色的,可以重复后退,进入OEM unlocking 选项操作,直到OEM unlocking 选项变为可设置。
11 . 运行如下命令进入bootloader模式
adb reboot bootloader
12. 运行下面的两条命令之一,进行bootloader解锁,根据不同机型进行选择
fastboot oem unlock
或者
fastboot flashing unlock