Debugging Cordova App (android) with Visual Studio 2015 New Emulator

Brett JB

I am not sure if this is me doing something stupid or just up against the bleeding edge.. I am developing a simple Cordova app but that is academic since I can repeat this issue with the standard 'Wizzard produced' default application.

I had the app working and debugging fine with VS2013 using both Ripple and occasionally with a real device. I don't have permanent access to the device so I thought Id try the new VS2015 CTP5 with emulator. So far so good. All builds ok and the app does get deployed to the emulator, and starts. However, VS is stuck in the 'deploying' process and never comes out. To the extent that I have to 'ctrl-Break' out of it. and the debugger never starts.. The last few lines of the build output are:

2>  Built the following apk(s):
2>      C:\Users\Brett\Documents\VisualStudioCordova\Projects\mblapp\mblapp\bld\Debug\platforms\android\ant-build\CordovaApp-debug.apk
2>  Using apk: `C:\Users\Brett\Documents\VisualStudioCordova\Projects\mblapp\mblapp\bld\Debug\platforms`\android\ant-build\CordovaApp-debug.apk
2>  Installing app on device...
2>  Launching application...
2>  LAUNCH SUCCESS
2>  Command finished with error code 0: `C:\Users\Brett\Documents\VisualStudioCordova\Projects\mblapp\mblapp\bld\Debug\platforms`\android\cordova\run.bat --nobuild,--target=169.254.138.177:5555,--debug
2>  

So there is an error there but I really don't get what it means..

Ok, So I went back to VS2013 but now the 2015 install has changed something and using Ripple it now breaks out of the code at unexpected places in the code.. not breakpoints.. and the javascript console says 'Paused at breakpoint' in its dropdown. I cant access the 2015 Emulator directly, but out of interest I left the emulator running after 2015 was closed and CAN connect AND debug using VS 2013.. great.. but its not a great way to start debugging..

I really like the look of the new Emulator and it does seem to work great with 2013.. so does anyone out there know how to make VS2013 deploy to the new emulator? .. I tried running it and did have some success. But I cant find where VS2015 has hidden its VHD file..

Or, does anyone know why VS2015 might not be deploying correctly.. Im happy to go with a solution that works.. Just that right now Im stuck not going forward, and its an uninstall 2015 and probable reinstall 2013 to go back... Many thanks.

Brett JB

OK.. Ive posted this as an answer because it does deal with part of it.. and I did struggle a bit so it might help someone else. Running the emulator from VS2013. You need to go to the folder

C:\Program Files (x86)\Microsoft Visual Studio Emulator for Android\1.0

where the emulator is installed. Having run it at least once from VS2015, it had created a file called vsemu.vhd and vsemu.sdcard.vhd. Copy both these files to something similar in the same folder I used 'myemu'. Then to start the emulator I created a simple shortcut with the target property:

"C:\Program Files (x86)\Microsoft Visual Studio Emulator for Android\1.0\XDE.exe" /vhd bretts.vhd /video 1080x1920

this sets the resolution too.. You can find all the startup flags etc by using:

...XDE /?

Im not sure yet, but I think it stored the various app shortcuts in the sdcard file.. although I wouldn't swear to it. Ill repost if something changes there.

Ok Debugging.. I started VS2013 and set the debug target as 'Device'. This worked fine.. so far.

Id still love to know why 2015 is not deploying properly though, for now I'll just assume its the 'bleeding' part of the bleeding edge. Cheers

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

App not run in visual studio emulator for android in visual studio 2015

From Dev

Visual Studio 2015 Error code 1 On Building Cordova App for Android

From Dev

Visual Studio 2015 Error code 1 On Building Cordova App for Android

From Dev

Visual Studio 2015 Android Emulator issue

From Dev

Unable to create new Blank App (Android) in Visual Studio 2015

From Dev

Debugging API in browser and Android app in emulator same time on one Visual Studio

From Dev

"Publish Android App" in Visual Studio 2015 RC with Apache Cordova is not doing anything

From Dev

"Publish Android App" in Visual Studio 2015 RC with Apache Cordova is not doing anything

From Dev

Unable to start debugging in Visual Studio RTM for cordova app

From Dev

Unable to start debugging in Visual Studio RTM for cordova app

From Dev

Debugging Appcelerator Windows Phone App with Visual Studio 2015

From Dev

Visual Studio Android emulator and Location changes with Apache Cordova

From Dev

Visual Studio Android emulator and Location changes with Apache Cordova

From Dev

Visual Studio Preview 2015 is missing "VS Emulator Android Phone"

From Dev

How to connect Visual Studio 2015 Android Emulator to network?

From Dev

Visual Studio Cordova App not updating on Android device

From Dev

Visual Studio Cordova App not updating on Android device

From Dev

Getting errors when deploying cordova app from visual studio 2015

From Dev

How to generate app files with Cordova and Visual Studio 2015?

From Dev

where to find cordova.js in the visual studio 2015 hybrid app

From Dev

Cannot compile Ionic Cordova (Update 6) app on Visual Studio 2015

From Dev

where to find cordova.js in the visual studio 2015 hybrid app

From Dev

Getting errors when deploying cordova app from visual studio 2015

From Dev

Visual Studio 2015 Debugging vs Not Debugging Views

From Dev

Cordova loading app into android emulator

From Dev

Updating cordova-android@ in Visual Studio 2015 RTM

From Dev

Updating cordova-android@ in Visual Studio 2015 RTM

From Dev

No emulator device found in my visual studio to run my android app

From Dev

Visual Studio Emulator for Android in visual studio 2013

Related Related

  1. 1

    App not run in visual studio emulator for android in visual studio 2015

  2. 2

    Visual Studio 2015 Error code 1 On Building Cordova App for Android

  3. 3

    Visual Studio 2015 Error code 1 On Building Cordova App for Android

  4. 4

    Visual Studio 2015 Android Emulator issue

  5. 5

    Unable to create new Blank App (Android) in Visual Studio 2015

  6. 6

    Debugging API in browser and Android app in emulator same time on one Visual Studio

  7. 7

    "Publish Android App" in Visual Studio 2015 RC with Apache Cordova is not doing anything

  8. 8

    "Publish Android App" in Visual Studio 2015 RC with Apache Cordova is not doing anything

  9. 9

    Unable to start debugging in Visual Studio RTM for cordova app

  10. 10

    Unable to start debugging in Visual Studio RTM for cordova app

  11. 11

    Debugging Appcelerator Windows Phone App with Visual Studio 2015

  12. 12

    Visual Studio Android emulator and Location changes with Apache Cordova

  13. 13

    Visual Studio Android emulator and Location changes with Apache Cordova

  14. 14

    Visual Studio Preview 2015 is missing "VS Emulator Android Phone"

  15. 15

    How to connect Visual Studio 2015 Android Emulator to network?

  16. 16

    Visual Studio Cordova App not updating on Android device

  17. 17

    Visual Studio Cordova App not updating on Android device

  18. 18

    Getting errors when deploying cordova app from visual studio 2015

  19. 19

    How to generate app files with Cordova and Visual Studio 2015?

  20. 20

    where to find cordova.js in the visual studio 2015 hybrid app

  21. 21

    Cannot compile Ionic Cordova (Update 6) app on Visual Studio 2015

  22. 22

    where to find cordova.js in the visual studio 2015 hybrid app

  23. 23

    Getting errors when deploying cordova app from visual studio 2015

  24. 24

    Visual Studio 2015 Debugging vs Not Debugging Views

  25. 25

    Cordova loading app into android emulator

  26. 26

    Updating cordova-android@ in Visual Studio 2015 RTM

  27. 27

    Updating cordova-android@ in Visual Studio 2015 RTM

  28. 28

    No emulator device found in my visual studio to run my android app

  29. 29

    Visual Studio Emulator for Android in visual studio 2013

HotTag

Archive