adb server version doesn't match this client

后端 未结 30 2420
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 09:49

Whenever I try to run adb devices:

            $ adb devices
            * daemon not running. starting it now *
            * daemon started su         


        
相关标签:
30条回答
  • 2020-11-22 10:13

    Did you try using the SDK version 8. Since the device is in 2.2, and your SDK is at 10, there might be conflict.

    Best of luck with ur downgrading efforts!! Hope this solves.

    0 讨论(0)
  • 2020-11-22 10:14

    Got a quick way to do it First

    sudo rm /usr/bin/adb
    

    Then

    sudo ln -s /home/{{username}}/Android/Sdk/platform-tools/adb  /usr/bin/adb
    

    Fastest way to fix the issue

    0 讨论(0)
  • 2020-11-22 10:16

    System: Windows 7, Android Studio.

    This error occurred when I ran adb devices from Windows Commandline.

    The root cause was that the adb I was running from commandline was not the same adb running from Android Studio.

    Solution:

    1. First kill all running adb processes on the machine.

      taskkill /F /IM adb.exe

    2. Run your app from Android Studio.

    3. Locate the exact File Location of adb.exe either from Windows Task Manager, OR by running the command below

      wmic process where "name='adb.exe'" get ProcessID, ExecutablePath

    4. On Windows Command prompt, run where adb to locate the adb that runs from command prompt. This path would be different from the one in Step 3 above.

    5. Edit Windows system variable PATH. Delete the base path found in Step 4 from it.

    6. After you have edited PATH, you can see the current contents of this variable by typing below command in a NEW command prompt (don't use old prompt.)

      echo %PATH%

    Now, run adb from command prompt. It should NOT show any "server out of date error"!

    0 讨论(0)
  • 2020-11-22 10:16

    installing sdk updates (including platform tools) fixed for me!

    0 讨论(0)
  • 2020-11-22 10:17

    System: Windows 10

    My issue: Setting Genymotion to point to the custom SDK didn't have any affect. I still received the:

    Couldn't start project on Android: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048) could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon

    What I discovered was there was a difference in ADB versions being used throughout the system. Here is the command I used to find them:

    where /r C:\ adb.exe
    

    This produced the results:

    C:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
    C:\Program Files\Genymobile\Genymotion\tools\adb.exe
    C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
    C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb backup\adb.exe
    

    Navigating to each directory and running:

    adb.exe version
    

    Allowed me to see that Expo was running ADB version:

    Android Debug Bridge version 1.0.36
    Revision fd9e4d07b0f5-android
    

    While Genymotion using the custom SDK had version (c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe):

    Android Debug Bridge version 1.0.39
    Revision 3db08f2c6889-android
    

    As a test I took the adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) from

    c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
    

    and placed them into a backup folder. I then moved the adb files located at

    c:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
    

    into that same location. I killed adb with:

    adb kill-server
    

    which caused a restart of the adb server automatically due to having my Genymotion device already running. I hit the "Restart" button inside of the Expo XDE and it immediately began working. Here is the log where I hit the restart button at 1:13:04 AM:

    12:45:53 AM
    could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon
    1:13:04 AM
    Restarting project and clearing packager cache (Hold shift while clicking restart to avoid clearing cache).
    1:13:11 AM
    Starting React Native packager...
    1:13:17 AM
    Scanning 543 folders for symlinks in C:\Users\kyle\git\betalog\node_modules (49ms)
    1:13:17 AM
    1:13:19 AM
    Couldn't adb reverse: closed
    1:13:20 AM
    Project opened! You can now use the "Share" or "Device" buttons to view your project.
    1:13:26 AM
    Couldn't adb reverse: closed
    1:13:26 AM
    Downloading latest version of Expo
    1:13:28 AM
    Installing Expo on device
    1:13:33 AM
    Opening on Android device
    1:13:56 AM
    Building JavaScript bundle: finished in 59643ms.
    1:14:01 AM
    Dependency graph loaded.
    1:14:03 AM
    Your JavaScript transform cache is empty, rebuilding (this may take a minute).
    

    Conclusion: Genymotion and Expo may need to use the same version of adb so that Expo can properly communicate with the simulated device. Pointing Genymotion to your android SDK location as well as ensuring Expo XDE has that same version will allow correct communication between devices. I moved the Expo XDE version to the SDK location, but you might be able to go the other way (take the sdk ADB files and place them in the Expo XDE resource location).

    P.S. I've been all through the stackoverflow posts related to this issue. Just so you guys know my task manager shows three instances of adb.exe running. If you kill any of them they just come back.

    Hope this helps /cheers

    0 讨论(0)
  • 2020-11-22 10:18

    I find I occasionally need to explicitly kill and restart the server manually:

    adb kill-server
    adb start-server
    

    This shock is generally enough to get it back on its feet again, and prevents repeated adb server is out of date. killing... messages.

    0 讨论(0)
提交回复
热议问题