0

Please don't mark this as a duplicate question.

When i m trying to run app in emulator or in real device everytime it throws an exception

Unable to connect to adb. Verify that your localhost entry is pointing to ip4 or ip6 respectively Android

For getting solution i dig google and tried the solution using

adb tcpip 5555

adb connect 127.0.0.1:5555

But every time it catch the same exception.

daemon not running; starting now at tcp:5037 adb F 05-03 12:32:21 9776 7156 main.cpp:45] cannot open C:\Users\admin\AppData\Local\Temp\adb.log: Permission denied

This application has requested the Runtime to terminate it in an unusual way.

Advanced help would be appreciated!

Community
  • 1
  • 1

3 Answers3

1

Open command Prompt use following commands

adb kill-server
adb start-server
adb devices // it will shows the device id if its connect success

if not showing the device restart android studio and mobile then execute the command again it will work

sasikumar
  • 12,540
  • 3
  • 28
  • 48
  • I did many times. But when i try to above it throw an exception _cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)_ –  May 03 '19 at 07:25
  • refer https://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp – sasikumar May 03 '19 at 09:14
  • https://stackoverflow.com/questions/51922573/android-adb-no-connection-could-be-made-because-the-target-machine-actively-ref – sasikumar May 03 '19 at 09:14
1

Finally i found an answer.

There was my silly mistake. While i was set JAVA_HOME path by

C:\Program Files (x86)\Java\jre1.8.0_211\bin

So just i needed to remove \bin. The correct path is

C:\Program Files (x86)\Java\jre1.8.0_211

Further i started Android Studio as Run as Administrator.

0

First, try running adb.exe in at the sdk/platform-tools. If it's not working then probably your adb.exe is broken. Then you need to download the sdk again or you can replace the platform-tools folder from some another pc. I also face that problem with Android Studio 3.4.

Dheeraj Rijhwani
  • 351
  • 5
  • 18