Android 开发命令工具错误排除 之 fastboot

本文介绍了一种解决Fastboot命令权限问题的方法。通过修改配置文件51-android.rules中设备的idProduct字段,使得Fastboot能够正确识别并操作目标设备。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用fastboot命令开始正常,后来出现如下错误,无法找到fastboot devices,打印信息如下:

lai@lai-ThinkPad-X61:~/ak-t34/arch/arm/boot$ fastboot devices

no permissions    fastboot
lai@lai-ThinkPad-X61:~/ak-t34/arch/arm/boot$ fastboot reboot
< waiting for device >
^C
lai@lai-ThinkPad-X61:~/ak-t34/arch/arm/boot$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 005 Device 002: ID 4348:5523 WinChipHead USB->RS 232 adapter with Prolifec PL 2303 chipset
Bus 002 Device 012: ID 18d1:0002 Google Inc.
lai@lai-ThinkPad-X61:~/ak-t34/arch/arm/boot$

于是查看原有的配置文件51-android.rules :

lai@lai-ThinkPad-X61:~/ak-t34/arch/arm/boot$ vi /etc/udev/rules.d/51-android.rules

原有内容:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="0005", MODE="0666",OWNER=="lai"
修改为:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="0002", MODE="0666",OWNER=="lai"

lai@lai-ThinkPad-X61:~/ak-t34/arch/arm/boot$ fastboot devices
SMDKC110-01    fastboot

这样可以使用fastboot命令烧写了




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、付费专栏及课程。

余额充值