在cmd窗口输入adb shell提示:device offline

本文解决了一个常见的技术问题:手机连接电脑时USB调试功能未开启导致的连接失败。通过指导用户进入系统设置,找到开发人员选项并启用usb调试模式,成功解决了手机与电脑之间的连接问题。



 

出现这个的原因是因为没有把手机连接到电脑上,解决方法:【系统设置】——【开发人员选项】——【usb调试】,选择连接usb后启用调试模式



 



 

D:\AirtestIDE-win-1.2.17\AirtestIDE\airtest\core\android\cap_methods\adbcap.py:10: UserWarning: Currently using ADB screenshots, the efficiency may be very low. warnings.warn("Currently using ADB screenshots, the efficiency may be very low.") [15:35:46][DEBUG]<airtest.core.android.adb> C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -P 5037 -s 6D6T45N7WWH6JRAU shell screencap -p queue size is: 10 Traceback (most recent call last): File "app\plugins\devicepool\main_window.py", line 83, in _add_device_view File "app\plugins\devicepool\main_window.py", line 116, in _change_current_view File "app\plugins\devicepool\android\view.py", line 353, in turn_on File "app\plugins\devicepool\android\device.py", line 291, in start_push_flow File "airtest\core\android\android.py", line 239, in screen_proxy ori_function=lambda: self.display_info) File "airtest\core\android\cap_methods\screen_proxy.py", line 101, in auto_setup if cls.check_frame(screen): File "airtest\core\android\cap_methods\screen_proxy.py", line 53, in check_frame cap_method.get_frame() File "airtest\core\android\cap_methods\base_cap.py", line 28, in get_frame return self.get_frame_from_stream() File "airtest\core\android\cap_methods\adbcap.py", line 11, in get_frame_from_stream return self.adb.snapshot() File "airtest\core\android\adb.py", line 831, in snapshot raw = self.cmd('shell screencap -p', ensure_unicode=False) File "airtest\core\android\adb.py", line 234, in cmd raise DeviceConnectionError(stderr) airtest.core.error.DeviceConnectionError: b"error: device '6D6T45N7WWH6JRAU' not found\r\n" Sentry responded with an error [15:35:46][DEBUG]<airtest.core.android.rotation> orientationWatcher has ended [15:35:55][DEBUG]<airtest.core.android.adb> C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -P 5037 -s 6D6T45N7WWH6JRAU shell input keyevent HOME Traceback (most recent call last): File "airtest\core\android\adb.py", line 413, in shell out = self.raw_shell(cmd) File "airtest\core\android\adb.py", line 371, in raw_shell out = self.cmd(cmds, ensure_unicode=False) File "airtest\core\android\adb.py", line 236, in cmd raise AdbError(stdout, stderr) airtest.core.error.AdbError: stdout[b''] stderr[b'error: device offline\r\n'] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "app\plugins\devicepool\android\device.py", line 329, in operate_button File "airtest\core\android\android.py", line 519, in keyevent self.adb.keyevent(keyname) File "airtest\core\android\adb.py", line 430, in keyevent self.shell(["input", "keyevent", keyname.upper()]) File "airtest\core\android\adb.py", line 415, in shell raise AdbShellError(err.stdout, err.stderr) airtest.core.error.AdbShellError: stdout[b''] stderr[b'error: device offline\r\n']
07-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值