2

I am trying to connect to an android vm running through genymotion. However, I keep getting the following error message when I try to connect via adb:

adb server version (41) doesn't match this client (39); killing...

I have seen many others have this issue, and I have tried everything and for some reason I still can't get it to work. I have genymotion using the android SDK instead of genymotion's default.

I think the error might lie somehwere with me have trying to get genymotion working correctly under some other installation steps, as when I execute adb --version I get the following:

Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04

Has anyone else ran into this problem? If it makes a difference, I am currently using Ubuntu 18.04, and my emulator is not connected to wifi. Thanks for all of those who reply in advance.

3 Answers 3

3

This actually solved my problem sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb

2
  • 2
    I would HIGHLY advise against overwriting a system-managed executable with an executable from your own home directory. That is just bound to cause problems in the future. The correct approach would be to ensure that your environment PATH is configured correctly.
    – Spencer D
    Jun 7, 2019 at 2:19
  • Worked Thanks!!!
    – Lokesh
    Jul 26, 2020 at 11:39
1

In genymotion go to SettingsADB and select the SDK you installed.

0

I have definitely encountered that error message when trying to connect to a Genymotion VM using the Android SDK platform-tools ADB instead of using the Genymotion-provided version; however, I have not attempted to configure Genymotion to use the Android SDK-provided ADB.

I would try connecting with the Genymotion-provided version. It sounds like Genymotion may not be respecting the configuration you put in place.

This is the issue I have observed:

Genymotion failure to connect with wrong ADB.

As shown in that screenshot. This issue definitely occurs when you attempt to connect with a version of ADB that does not match the version being used by Genymotion.

To confirm which version is being used by Genymotion (i.e., to make sure it is respecting your configurations), run the following:

netstat -tlpn | grep -i adb

That should tell you the process ID of the ADB server that is listening for connections. Using that process ID, we can determine which version of ADB is executing via ls -la /proc/ADB_PROCESS_ID/ (Obviously, substitute in the numerical process ID.)

For example, I can see that the ADB server running on my side is /opt/genymobile/genymotion/tools/adb, as is pictured below:

Example of the aforementioned steps showing which executable ADB server is using

If Genymotion does appear to be using the version of ADB you expected it to use, then you might want to run which adb and subsequently readlink "$(which adb)". If that result is unexpected, then you should either make sure the directory to the correct adb appears sooner in your PATH environment variable, or you could try adding an alias for adb which points explicitly to the correct path. (I would probably append to the front of the PATH rather than using an alias, since other applications you run will be more likely to respect the PATH than they will to respect an alias.)

If you find that the ADB path Genymotion refers to is different than the path ADB refers to, and you decide to resolve this by modifying your PATH, then you should modify the .bash_profile file in your home directory to add the following line (modify where necessary) to the bottom:

export PATH="/path/to/adb-directory:$PATH"

After that, you may need to run source ~/.bash_profile && hash -r and for the change to take effect. After that, if everything worked correctly, running the which adb command above should show the desired path to ADB.

2
  • Executing which adb gives me /usr/bin/adb then executing the command readlink "$(which adb)" gives me ../lib/android-sdk/platform-tools/adb So I am assuming that the adb that genymotion wants to use it not on my PATH ? How would I go about adding it to the PATH ? I am completely new to Ubuntu.
    – aty0
    May 20, 2019 at 21:43
  • Hey, @aty0, sorry for not getting back to you sooner. (Busy week.) One sec and I'll add some info for that to the end of my answer.
    – Spencer D
    May 26, 2019 at 2:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .