2 Replies Latest reply on Dec 14, 2012 2:51 AM by Val Palhories

    Debugging a RhoMobile Application - Not using alerts

    Val Palhories

      Hello,

       

      Not really sure how to word this so I'll try my best. In the Visual Studio IDE, I can open the Immediate window when I'm debugging an application and type ? {variable name} to get the contents of a variable or I can set the value of a variable {variable} = {value}. Is there something comparable in the Rho environment? Right now, we're resorting to Alerts which is a PITA!

       

      Thanks.

       

      -- Val

        • Re: Debugging a RhoMobile Application - Not using alerts
          Jon Tara

          What part are you debugging? Ruby code, or Javascript?

           

          For Ruby code, code that is not specific to Rhodes can first be debugged using any Ruby debugger - irb at the most basic level, but there are plenty of great GUI tools out there. I typically first develop what I can as a Ruby command-line program.

           

          Rhodes has a GUI Ruby debugger in RhoStudio if you use the RhoSimulator. I don't use the RhoSimulator, though, I just log to rholog.txt and view the log as it is produced.

           

          For Javascript, there are many tools available, depending on your platform. For iOS, starting with version 6, for example, you can simply enable Javascript debugging on your device, connect to your Mac with a USB cable, open Safari, and in the developer menu you will find your device. You simply open a remote debugging session to your device, and you can use Web Inspector. (This works for Apple simulator, as well - you don't need to change any Settings in this case.)

           

          For Android, you can use Weinre.

           

          As well, you can set a fixed port address in rhoconfig.txt, and then you can connect to the Rhodes server with any browser, and use Web Inspector, Firebug, etc.

          1 of 1 people found this helpful