I am running my android appium execution on MAC machine.
I have installed android studio and have set the path variable.
While executing adb start-server I got below error:
adb server version (32) doesn't match this client (36); killing...
error: could not install smartsocket listener: Address already in use
ADB server didn't ACK
failed to start daemon
error: cannot connect to daemon
Firewall setting is turned OFF and no other ADB present like GenyMotion.
Did you set android sdks, platform-tools and tools path in your bash_profiles? Or Could you navigate to android sdks path and try to execute adb start-server command? If you are running appium from appium app then I would recommend to set android sdks path in settings.
Related
Running on Ubuntu 20.04 (WSL2):
➜ ~ adb --version
Android Debug Bridge version 1.0.41
Version 33.0.1-8253317
Installed as /home/eliya/dev/Android/platform-tools/adb
Running
➜ ~ adb devices
adb W 04-28 16:43:11 20145 20145 network.cpp:149] failed to connect to '172.23.160.1:5037': Connection timed out
* cannot start server on remote host
adb: failed to check server version: cannot connect to daemon at tcp:172.23.160.1:5037: failed to connect to '172.23.160.1:5037': Connection timed out
Running
➜ ~ adb start-server
adb W 04-28 16:47:17 21475 21475 network.cpp:149] failed to connect to '172.23.160.1:5037': Connection timed out
* cannot start server on remote host
error: cannot connect to daemon at tcp:172.23.160.1:5037: failed to connect to '172.23.160.1:5037': Connection timed out
But when I run it as root, it seems to work fine:
➜ ~ sudo adb devices
List of devices attached
XXXXXXXXXXXXXX device
How can I make adb to work without sudo permissions?
Update 1
running adb -H localhost ... seems to be ok. What am I missing here?
Update 2
Running in Windows:
PS C:\Users\coeli> adb start-server
and then in WSL2 (hangs for a while and then fails):
➜ ~ adb devices
List of devices attached
* cannot start server on remote host
error: cannot connect to daemon at tcp:172.23.160.1:5037: Connection timed out
If you want WSL to be able to talk with the adb server running in Windows, you have to start the server in such a way that it will listen on all interfaces, not just the default one. This is done with -a, like so:
.\adb.exe -a nodaemon server start
You can also put a -P in there if you want to use something other than the default port of 5037, like this:
.\adb.exe -a -P 5037 nodaemon server start
If you still have problems, double-check your Windows Firewall. However, since this is all local interface stuff, that shouldn't be a factor in most installations.
I think I may have found a fix for this. In my case, the issue was caused by not installing sdkmanager properly. I used openjdk11 instead of openjdk8, which is required by the sdkmanager to run properly. In anycase, following this tutorial https://gist-github-com.translate.goog/georgealan/353a548814fe9b82a3a502926c7a42c6?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#passo-4%C2%BA
should allow you to get it up and running without needing to use sudo commands. Article is for ReactNative but you dont need to follow the whole thing
I am working on react native I am beginner and I facing problem to set the environment for react native. I have followed 'https://facebook.github.io/react-native/docs/getting-started' and installing on ubuntu but when I run the command 'react-native run-android' I get the errors:
Starting a Gradle Daemon (subsequent builds will be faster)
[adb]: adb server version (31) doesn't match this client (40); killing...
[adb]: * daemon started successfully
Task :app:installDebug
Installing APK 'app-debug.apk' on 'Nexus_6_API_27(AVD) - 8.1.0' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL in 37s
27 actionable tasks: 1 executed, 26 up-to-date
Running /home/shafi/Android/Sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
adb server version (31) doesn't match this client (40); killing...
* daemon started successfully
Starting the app on emulator-5554 (/home/shafi/Android/Sdk/platform-tools/adb -s emulator-5554 shell am start -n com.namal/com.namal.MainActivity)...
Starting: Intent { cmp=com.namal/.MainActivity }
Try these 2 commands with sudo
adb kill-server
adb start-server
Then run react-native run-android command and see if it's work.
If it is not working, try below commands
adb kill-server
emulator -avd Nexus_6_API_27 -port 5557
adb start-server
Then run react-native run-android command.
I have tried different solution, But below works for me -
Under Home folder (eg:- C:\Users\Lenovo) > find and delete .Android folder
Goto, C:\Users\Lenovo\AppData\Local\Android > delete platform-tools folder
Again install/download from Android SDK Manager (note: you can open android studio -> tool -> SDK Manager select (eg Android 9.0) apply and ok
( reopen android studio then you can see connected device)
if you use visor/ total controller :-
Open terminal -
adb kill-server
adb start-server
Check adb devices, It will work and display you all connected devices.
when I tried the above commands still there was problem of adb is out of date then I find a link ('adb server is out of date. killing') to change my bin because I was having problem with adb and I used these two following commands and it worked
Blockquote
sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb
sudo chmod +x /usr/bin/adb
On Windows, you can check Task Manager to see what adb.exe processes are running. You can right-click on one of these processes to see the location of the adb.exe file, which may show that it's running as part of an program other than the Android SDK / React-Native.
In my case, I found that the Oculus Developer Hub program came with its own version of ADB, and that copying the following files from my Unity platform-tools folder (in your case, you'd want your Android SDK platform-tools folder) into the Oculus Developer Hub folder resolved the issue - you may just want to uninstall the offending software, but copying the files across should ensure that adb versions are compatible. After copying the files, I ran stopped any adb.exe processes running (using Task Manager), and then restarted Unity.
Files:
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
I am using Android Studio 2.2.3. Everything is up to date.
Running "adb shell" on Terminal in Android Studio generates the following:
adb server is out of date. killing...
* daemon started successfully *
error: device not found
To reconnect the device, I have to run "adb kill-server" first.
This makes running shell commands impossible.
Could anyone offer a tip on how to fix this?
From Android Studio Terminal run
$ $ANDROID_HOME/platform-tools/adb shell
this ensures you will be using the same adb.
After reading many threads (1, 2, 3) and trying many solutions in SO regarding similar error, I still am unable to find a solution for this error.
$ adb devices
List of devices attached
adb server is out of date. killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error:
error:
I have Genymotion 2.7.2, have provided explicit sdk path under Genymotion -> adb -> Android SDK, using adb version 1.0.32.
open task manager and find adb.exe and kill it, then restart your eclipse and
type adb kill-server in your cmd (if you are using windows)
for other OS type killall adb
It used to work fine, but today after I connected my Android phone to my machine, and run adb devices, I got the following error:
* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon: Operation timed out
How to solve this problem? (I am using a MacBook)
Try with following commands
Find port details by List Open Files lsof command.
sudo lsof -i :5037 and find PID and kill it.
kill -9 <pid here>
Example: kill -9 4363
Then start adb server. adb devices command.
Kill the Adb server and restart.
adb kill-server
adb start-server
I managed to solve this problem on MacBook by first running the following command to list the process which is using port 5037
lsof -n -i4TCP:5037 | grep LISTEN
Then, I kill it:
kill -9 <PID>
Then, adb devices works!
Android Studio Terminal
$ adb devices
List of devices attached
adb server is out of date. killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error:
error:
OS Terminal
$ adb devices
List of devices attached
adb server is out of date. killing...
* daemon started successfully *
Finally test again at the IDE terminal
$ adb devices
List of devices attached
GL
it is clear that Address already in use. busybox netstat -antp to check who is using the port.
I've fixed the problem by updating the Android SDK.
android update sdk --no-ui
Additionally, I've updated the Platform Tools to the newest version.
If this doesn't work, redownload android sdk.
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz cd android-sdk-linux/tools
install all sdk packages
./android update sdk --no-ui
I tried it at the OS Terminal, worked.
Try on the OS terminal first
Running the following command at the OS bash helped solve the issue:
sudo adb start-server
I ran adb kill command and then it started working fine
adb kill-server
adb start-server