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.
This actually solved my problem
sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb
In genymotion go to Settings → ADB and select the SDK you installed.
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:
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:
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: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 subsequentlyreadlink "$(which adb)"
. If that result is unexpected, then you should either make sure the directory to the correctadb
appears sooner in yourPATH
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 thePATH
rather than using an alias, since other applications you run will be more likely to respect thePATH
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 thewhich adb
command above should show the desired path to ADB.