赞
踩
测试小白,学习自动化测试,连接夜神模拟,真机也试过了,同样报错,这是问题是迄今为止我遇到最der(东北话)的问题,网上百度五花八门,全都是屁话,测试论坛发帖无人回复,真的跪了。我今天把自己的解决方法分享出来,希望帮到大家。
无奈软件开发,从入门都精通的过程就是从不断挖坑到不断填坑的过程,第一次发帖的时间为2020-01-02,这次更新的时间是2020-01-30,再次把我解决问题的方法完善,供大家参考。
描述如下
[ADB] Could not find devices, restarting adb server... [ADB] Restarting adb [ADB] Killing adb server on port 5037 [ADB] Running 'D:\Sets\Android\android-sdk\platform-tools\adb.exe -P 5037 kill-server' [ADB] Could not find devices, restarting adb server... [ADB] Restarting adb [ADB] Killing adb server on port 5037 [ADB] Running 'D:\Sets\Android\android-sdk\platform-tools\adb.exe -P 5037 kill-server' [ADB] Could not find devices, restarting adb server... [ADB] Restarting adb [ADB] Killing adb server on port 5037 [ADB] Running 'D:\Sets\Android\android-sdk\platform-tools\adb.exe -P 5037 kill-server' [UiAutomator2] Deleting UiAutomator2 session [BaseDriver] Event 'newSessionStarted' logged at 1577948298976 (14:58:18 GMT+0800 (中国标准时间)) [MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device. [MJSONWP] at getDevices (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\node_modules\appium-adb\lib\tools\system-calls.js:203:13) [MJSONWP] at getDevices (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\node_modules\appium-adb\lib\tools\system-calls.js:220:20) [HTTP] <-- POST /wd/hub/session 500 37991 ms - 179 [HTTP] [HTTP] --> DELETE /wd/hub/session [HTTP] {} [HTTP] No route found. Setting content type to 'text/plain' [HTTP] <-- DELETE /wd/hub/session 404 2 ms - 57 [HTTP]
PS C:\WINDOWS\system32> adb connect 127.0.0.1:62001
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
这个问题网上找,真的,真的,很普遍,但你肯能使用的所有解决方法都没法解决问题,确实存在SDK中adb与夜神中nox_adb版本不一致的问题,我说说我的解决办法。
有时候直接操作第二步就可以
进入夜神模拟安装目录的bin文件夹中
(当然办法有很多,可以直接把它(路径)添加到系统环境变量path中)
分别输入
nox_adb connect 127.0.0.1:62001 (1)
nox_adb devices (2)
以管理员身份进入Windows PowerShell,输入以下命令
adb connect 127.0.0.1:62001
输入adb devices
出现显示127.0.0.1:62001 device,说明连接成功
2、右键管理员身份启动Appium,启动服务,启动Session,成功!!!!!!
查看所有连接的PID
netstat -ano
查看占用“某”端口程序
netstat -ano|findstr "某"
tasklist|findstr "PID"
结束该进程两种命令
第一种: taskkill /f /t /im ****.exe
第二种:taskkill /F /pid “PID”
PS C:\WINDOWS\system32> adb connect 127.0.0.1:62001
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
netstat -ano|findstr "5037"
查看它的PID,然后好结束掉占用5037端口的应用,就出现了下面的情况netstat -ano|findstr "5037"
却出现tasklist|findstr "57248"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。