控制台提示: ADB rejected shell command (ls -l ): closed

本文介绍了解决ADB调试中出现的“ADBrejectedshellcommand”提示问题的方法。对于真机调试,可通过关闭并重新开启USB调试功能来解决;而对于模拟器,则需确保androidemulator已启动,并正确配置runconfigurations。

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

控制台每隔几秒就会弹出一个

ADB rejected shell command (ls -l /): 提示

解决办法:在手机上关闭USB调试,再重新打开即可。

具体步骤:系统设置——>应用程序——>开发——>USB调试 关闭后,再打开。

网上搜了一下,如果是模拟器,入到此问题,应该使用如下解决方案:

出现这个问题,是由于在运行过程中,android emulator 没有打开,可以在run configurations--target-automatic-设置自己的android-version上面打勾,然后点击start--Apply 就ok

``` @echo off :begin echo ***************************************************************************** echo ** ** echo ** 注意:请将设备【WiFi打开】【蓝牙关闭】,写号前将设备通过USB连接至电脑 ** echo ** 注意:请按照蓝牙Mac地址在前,WiFi Mac地址在后的顺序录入 ** echo ** ** echo ***************************************************************************** echo. :: set /p arr=请顺序输入蓝牙Mac地址和WiFi Mac地址,以空格隔开: :: for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12 delims= " %%a in ("%arr%") do ( :: set num1=%%a :: set num2=%%b :: set num3=%%c :: set num4=%%d :: set num5=%%e :: set num6=%%f :: set num7=%%g :: set num8=%%h :: set num9=%%i :: set num10=%%j :: set num11=%%k :: set num12=%%l :: ) :: 此方案不需要工厂标签二维码有特殊格式,顺序输入即可。eg:112233445566aabbccddeeff set /p arr=请顺序输入蓝牙Mac地址和WiFi Mac地址: set num1=%arr:~0,2% set num2=%arr:~2,2% set num3=%arr:~4,2% set num4=%arr:~6,2% set num5=%arr:~8,2% set num6=%arr:~10,2% set num7=%arr:~12,2% set num8=%arr:~14,2% set num9=%arr:~16,2% set num10=%arr:~18,2% set num11=%arr:~20,2% set num12=%arr:~22,2% echo adb root adb root :: 打开WiFi、关闭BT adb shell svc wifi enable adb shell svc bluetooth disable :: 预留开关响应时间2s timeout /t 2 /nobreak >nul echo ***************************************************************************** echo ** ** echo ** 开始写入蓝牙地址 : %num1% %num2% %num3% %num4% %num5% %num6% ** echo ** ** echo ***************************************************************************** adb shell wifitest -O adb shell wifitest -E 0x138 adb shell wifitest -e 0x138 -v 0x67 adb shell wifitest -e 0x139 -v %num1% adb shell wifitest -e 0x13A -v %num2% adb shell wifitest -e 0x13B -v %num3% adb shell wifitest -e 0x13C -v %num4% adb shell wifitest -e 0x13D -v %num5% adb shell wifitest -e 0x13E -v %num6% :: boots 方案回显有较多的fail,影响产线判断先不用,待产线测试wifitest的稳定性再决定是否启用 :: 目前遇到的问题是单独操作boots可以写成功,但是放在bat顺序执行会概率性执行不下去。 :: adb shell boots -c efuse -r -a 0x138 :: adb shell boots -c efuse -w -a 0x138 -v 0x67 :: adb shell boots -c efuse -w -a 0x139 -v %num1% >nul :: adb shell boots -c efuse -w -a 0x13A -v %num2% >nul :: adb shell boots -c efuse -w -a 0x13B -v %num3% >nul :: adb shell boots -c efuse -w -a 0x13C -v %num4% >nul :: adb shell boots -c efuse -w -a 0x13D -v %num5% >nul :: adb shell boots -c efuse -w -a 0x13E -v %num6% >nul echo ***************************************************************************** echo ** ** echo ** 开始写入WiFi地址 : %num7% %num8% %num9% %num10% %num11% %num12% ** echo ** ** echo ***************************************************************************** :: adb shell wifitest -O adb shell wifitest -e 4 -v %num7% adb shell wifitest -e 5 -v %num8% adb shell wifitest -e 6 -v %num9% adb shell wifitest -e 7 -v %num10% adb shell wifitest -e 8 -v %num11% adb shell wifitest -e 9 -v %num12% echo 设备重启 adb reboot pause goto begin :: adb shell wifitest -e 4 -v 0xec :: adb shell wifitest -e 5 -v 0x20 :: adb shell wifitest -e 6 -v 0x14 :: adb shell wifitest -e 7 -v 0x05 :: adb shell wifitest -e 8 -v 0x11 :: adb shell wifitest -e 9 -v 0x17 :: goto begin```请帮我优化下代码,注意输入的字符在保存到数组的时候需要以0x形式保存
最新发布
03-20
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值