Unable to debug cordova app due to adb.exe
Asked Answered
D

7

14

I have just created a plain 'helloworld' cordova app on Visual Studio. I can't debug my app on either android emulator or device though it works only in the ripple emulator. Please help.

I keep getting error "Unable to start mypathname/adb.exe"

enter image description here

  1. Tried adb kill-server and adb start-server in cmd (result: server restarted successfully)

  2. Installed necessary mobile driver and upgraded my driver too

  3. Configured to set allow for USB debugging under Developer options

  4. Devices are detected and shown enter image description here

Dishrag answered 26/12, 2014 at 9:9 Comment(4)
Did you check that adb.exe exists in that actual path?Chemush
Yes and when I click on the adb.exe the cmd auto run and exit itself.Dishrag
I have the same problem. For me it is working with new emulators and I try to debug via browser. App is instaling on device so for ms dev is small issueAperiodic
Have you looked at the actual row that gives error on background in your screenshot? The ILLEGAL usually stands for character set issues and as you can see on the first error line.Chemush
C
8

Which Android versions are you using? There seems to be known issue for Visual Studio & Cordova that says

When using the VS Debugger with Android < 4.4 emulators, devices, or Apache Ripple™: While debugging to devices with Android versions <4.4, an error popup shows up “Unable to start program” citing “adb.exe” as the cause. The app should still load and work on your device, without debugger support.

and the status seems to be No fix available.

Chemush answered 4/1, 2015 at 16:38 Comment(3)
My android phone's version is 4.4.4Dishrag
This helped. I was getting the same error when I used a device with Android Ice Cream Sandwich. Tried with a Lollipop one and the error message didn't show up.Chisholm
I don't have any issues with my Galaxy S6, but when I try to debug on a Kindle Fire HD 8.9 (which is allegedly "based on Android 4.4.2, API level 19"), I get the error. developer.amazon.com/appsandservices/solutions/devices/…Telesthesia
J
2

Go to Build/Configuration manager and check if you have choosen Debug configuation instead of Release.

Jezabella answered 21/7, 2015 at 6:14 Comment(2)
its not a solution. The problem is with adbAbrahamsen
Thanks a lot, this really worked to debug on Android devices!! I was getting a similar adb.exe error with the Release configuration.Protozoology
M
1

Assuming adb is in your path (otherwise CD to the correct path), try adb devices from the command line, and see if you have more than one device listed.

If so, check if you have other emulators running - such as blustacks, and close / kill these and try again.

Melodious answered 26/5, 2015 at 14:57 Comment(0)
C
1

You cannot use the VS Debugger for apps deployed to emulators or devices running Android versions prior to 4.4 without the use of a 3rd party plugin like jsHybugger. JavaScript console output is, however, captured in the Output window.

While debugging to devices with Android versions prior to 4.4, an error popup may display the error “Unable to start program” citing “adb.exe” as the cause. The app should still load and work on your device, without debugger support.

Checkerwork answered 6/5, 2016 at 17:42 Comment(0)
C
0

After doing much more research, I discovered this thread on Google and it with the fact that browsers also show error Unexpected token ILLEGAL to signal about invisible characters etc. that are usually there by accident, were enough for me to think that you have UNIX style line changes which Visual Studio can't tolerate.

Fixing this isn't too easy on Windows, but you can download unix2dos here (I know it looks suspicious, but it is recommended by 110k user on ServerFault here) and use it to convert all the files in that project. You can also obtain the basic project from other sources such as Apache Cordova Hello World Application on GitHub.

Chemush answered 11/1, 2015 at 11:11 Comment(0)
F
0

AppGyver's Steroids tooling works on Windows and provides you with enhanced access to the Chrome Inspector for debugging what happens in the WebView, so you don't necessarily need to rely on Visual Studio's debugging tools.

You can run Steroids it in your Cordova project directly without modifying any files.

(Disclaimer: I'm a programmer for AppGyver.)

Fascia answered 12/1, 2015 at 15:23 Comment(0)
D
0

Running Visual Studio as administrator solved the problem.

Delta answered 22/7, 2015 at 13:34 Comment(1)
For me on Win7 32bit, not solved the problem but the app launched on the device(did not do without 'as admin') after hit the OK buttonHedges

© 2022 - 2024 — McMap. All rights reserved.