Debugging support

10 posts, 0 answers
  1. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 09 Mar 2015 Link to this post

    Hi,
    Is there a blog article or tutorial on how to get the debugging support introduced with the NS beta version to work?

    I'm using the AppBuilder WIndows client and have followed the information included in the AB help screens. I've used the AB Build and deploy command to install the app on my iPhone, I've attached the debugging process and get the Debug on Device [Experimental] NativeScript to open but I can't figure out how to set breakpoints or debug the application.

    Best regards, Ian
  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 10 Mar 2015 Link to this post

    Hello,

    The AB will deploy the app and you will have to manually start it. Also the AB will open the inspector tools and try to connect over USB to the device and "talk" with the JavaScript VM.

    Could you elaborate more on the behavior you observe? More importantly: Does the app gets deployed? Does the inspector tools open? Do you manually launch the app? Does the inspector populate with the scripts on the device?

    Regards,
    Pana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 10 Mar 2015 in reply to Pana Link to this post

    Hi Pana,
    Here's a summary of what happens...

    I open my app in the AB Windows client. (The app works fine when I run it via the NS companion app by the way.)
    I choose Run|Build and deploy.
    The Build and deploy window opens. It confirms I can deploy on my device.
    I click Run in the bottom RH-corner of the window.
    A Build and deploy... message and activity graphic is displayed. This is displayed for around 90 seconds.
    The AB status bar confirms No errors in solution.
    The AB Notification history confirms the app was built and deployed.
    The AB log confirms that the app was successfully deployed to my iPhone.
    I start my app manually on the iPhone.
    On the AB Devices tab I click Debug.
    My app is listed. I select my app and click Attach.
    The DebugOnDevice [Experimental] NativeScript window opens. 
    I try clicking the Resources, Timelines, Debugger toolbar buttons but no scripts or any data is displayed.
    Some time later a dialog is displayed stating Connection lost. Debugging session ended.

    Am I missing a step somewhere? Do I need to click something to start debugging the app?

    Best regards, Ian
  4. Pana
    Admin
    Pana avatar
    748 posts

    Posted 13 Mar 2015 Link to this post

    Hello,

    You are doing it right, but obviously we are experiencing an issue. Does your app run? Is it possible that a JavaScript error crashed the app before the debugger is attached?

    Can you tried to close and start the app after the inspector is opened. By double tapping the "home" button and dragging up the app, and then launching it again.

    Regards,
    Pana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 13 Mar 2015 Link to this post

    Hi Pana,
    My app builds OK and appears to work fine using the NS companion app. In order to eliminate it as the possible cause, I did a Build and deploy on the NS Master-Detail demo app. This installed OK on my iPhone and, interestingly, the very first time I ran it and invoked the debugger, the Debug on Device [Experimental] NativeScript window opened and I could see a list of .js files.

    Unfortunately, I wasn't able to ever recreate that scenario again. I tried closing and re-opening the app (as you suggested), I built and deployed the app again but I only ever got an empty inspector screen.

    In case it helps, here's the log file when I tried a build and deploy a second time...

    [2015-03-13 17:09:36.606] Log (Info,None): Project "MasterDetail.tmp.proj" (default targets):
    Done building project "MasterDetail.tmp.proj".

    Device storage detached on Ian’s iPhone for uk.anotrak.MasterDetail.
    Device storage detached on Ian’s iPhone for com.telerik.NativeScript.
    Device storage attached on Ian’s iPhone for com.telerik.NativeScript.
    Successfully deployed application uk.anotrak.MasterDetail to Ian’s iPhone.
    Device storage detached on Ian’s iPhone for com.telerik.NativeScript.
    Device storage attached on Ian’s iPhone for uk.anotrak.MasterDetail.
    Device storage attached on Ian’s iPhone for com.telerik.NativeScript.
    [2015-03-13 17:12:41.064] Log (Exception,High): System.TimeoutException: The operation has timed out.

    Server stack trace: 

    Exception rethrown at [0]: 
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
       at Telerik.BlackDragon.Client.Mobile.iOS.Inspector.RemoteWebView.<BeginDebuggingAsync>d__4.MoveNext()

    Regards, Ian
  6. Pana
    Admin
    Pana avatar
    748 posts

    Posted 19 Mar 2015 Link to this post

    Hello,

    We will investigate the issues further. Your feedback gave us an overview of what may go wrong. We will take care to log more details about the debugging connection process so that we can resolve similar issues easier in future, and try to improve the debugging handshake between the inspector and the NativeScript runtime.

    For now the only suggestion I may give you is to try to restart the device.

    Regards,
    Pana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 20 Mar 2015 in reply to Pana Link to this post

    Hi Pana,
    Thanks for the update. Restarting the device didn't help unfortunately.

    Are you expecting to issue a patch or hotfix once you've made the changes you described above or will I have to wait until next release of NS/AB? I'm just after an idea of how long it will be before I can try the debugging support again?

    Regards, Ian 
  8. Pana
    Admin
    Pana avatar
    748 posts

    Posted 25 Mar 2015 Link to this post

    Hello,

    We have a release planned for NativeScript late April that will get to the AB. It will have some improvements for the debugging. And the AB will add some tracing. I am not sure that this will solve your problem. But at least we will be able to collect more data to target it afterwards.

    Regards,
    Pana
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  9. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 25 Mar 2015 in reply to Pana Link to this post

    Hi Pana,
    Thanks for the update.

    As an alternative to using the AB Windows client to develop/debug a NS application, would using ABwith the Visual Studio extension be any different or is that likely to suffer from the same problems I've already experienced when trying to connect to and debug with an iPhone?

    Best regards, Ian
  10. Pana
    Admin
    Pana avatar
    748 posts

    Posted 31 Mar 2015 Link to this post

    Hello,

    I am sorry. It is probably the same. I would suggest you wait for the next release.

    Regards,
    Pana
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top