androidrubyruboto

What ruboto debugging tool should I use?


I am trying to leverage my very modest Ruby experience with Ruboto. I have installed the necessary packages, and the various demos work well on the simulator (on Windows) and on my Android device. I have been able to write some very simple Ruby scripts for Ruboto, but when they don't work, I have no visibility over what is happening. The only error message I get is: "Unfortunately, xyz has stopped."

I assume there must be a way to troubleshoot a Ruboto script and get a log or some kind of detailed information on the reaction of the system to each line of code.
I have been googling that question for a while without success, and I apologize if I missed something obvious. I also tried "adb catlog" without getting any useful information related to the Ruby script, but maybe I was not able to find the right information in the thousands of line generated by this command.

I hope someone can point me in the right direction. Thanks


Solution

  • At the moment, the debugging options for Ruboto are limited and low-tech.

    You can analyse the log using "adb logcat" or the newer "rake log". "rake log" uses "adb logcat" but applies a filter so you get much less noise. If your app crashes, you should see a Ruby stack trace with the immediate cause of the crash. This is probably what most Ruboto developers use now.

    Another option is to encapsulate a risky method with a "rescue" that either logs a better message, or displays the error in a dialog. This would probably be more helpful, but requires a bit more work. You could request this as a Ruboto feature in the Ruboto issue tracker :)