1

When my app has been successfully build and deployed through remotebuild it starts, but I never get any feedback in the JavaScript console and it doesn't break on breakpoints.

  • Developing on a Windows 10 machine with Visual Studio 2015 CE (office)
  • Connect over VPN to my Mac
  • iOS device (iPad mini) has local connection to development PC

I went through this page to configure everything: https://taco.visualstudio.com/en-us/docs/ios-guide/

The only thing that shows up in the JavaScript console after the app has started on my device is: Current window: file:///var/containers/Bundle/Application/51E50D1A-C71D-4C84-A67D-D5162B8C7595/com.domain.appname.app/www/index.html

  • Could you please try the steps that mentioned in [this case](http://stackoverflow.com/questions/35963752/apache-cordova-visual-studio-2015-tools-fails-to-launch-app-in-ios-simulator/35964139#35964139) – Elvis Xia - MSFT Aug 22 '16 at 01:54
  • This doesn't seem to have any effect. I tried a couple of times, also with higher values (up to 2 minutes). Weird thing is that Visual Studio becomes unresponsive when I close my app on the iPad (double press home-button and move app to top of screen). – CrashingDutchman Aug 22 '16 at 14:24
  • Did you open the Web Inspector on Safari settings?see [enable WebInspector](https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html#//apple_ref/doc/uid/TP40007874-CH2-SW8). If it doesn't work, try reset the settings. – Elvis Xia - MSFT Aug 23 '16 at 01:27
  • Yes, I did that before I started my post. I just noticed that the DOM Explorer is showing data from the app. If only console.log commands would appear in the JavaScript console. I also found that when I add an alert('message') just before a console.log('message') than I see the console.log in the JavaScript console in Visual Studio 2015 – CrashingDutchman Aug 23 '16 at 15:12

1 Answers1

0

I also have this Visual Studio debugger issue after the updates to OSX and iOS several weeks ago. Microsoft says they're working on a fix: https://github.com/Microsoft/remotebuild/issues/14 The following workaround may be obvious to folks who work with Cordova outside of VS, but it wasn't to me, maybe because I've always used the VS debugger. Hopefully, this will save someone some time.

After reading a bunch of stuff on the web, my workaround is to use my Mac's Safari Web Inspector debugger to step through my iOS Cordova app on my device. Here is a quick summary of the steps to take: http://geeklearning.io/apache-cordova-and-remote-debugging-on-ios/ You also need to enter this command from your Mac Terminal

defaults write com.bundle.identifier WebKitDeveloperExtras -bool true

as described in Apple's documentation: https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html#//apple_ref/doc/uid/TP40007874-CH2-SW1

So my work flow is to build and deploy my iOS cordova app from VS to my Mac in an iPhone Simulator. Once the app in my Mac Simulator launches, close it and then navigate to the app.xcodeproj in my Mac's Finder and launch the Xcode project. You have to unhide files on your Mac so you can navigate down your .taco_home path to the Xcode project. Connect my iPhone or iPad to my Mac and deploy the app to the iOS device from Xcode. Close Xcode. Next, with the iOS device connected to the Mac, relaunch the app in the device. Now launch Safari on the Mac. Navigate Safari > Develop > Your Device > Your App and boom, you're using the Web Inspector debugger on your Mac to step through your app's Javascript, set breakpoints, look at values and actually find bugs. Make sure the iOS device's Web Inspector is enabled: Setting > Safari > Advanced > Web Inspector > Enabled. Hope this helps someone.

pprchsvr
  • 168
  • 2
  • 13