What ruboto debugging tool should I use? - android

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

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 :)

Would something like "debugger" work here?
It would be awesome if it could...

Related

Having some trouble with android studio probably has a simple answer

I'm trying to install android studio, but while I was installing it I got this exception:
My question is what is the Android Emulator Hypervisor? what does it do or enable me to do? I tried looking it up online but I kept getting into these rabbit holes of information that kept expanding and expanding. I just want a concise answer for my small brain and maybe a quick and clear explanation to fix this.
The emulator essentially creates virtual machines running specific Android versions in order to run your apps. The Hypervisor driver is something that can help a lot with performance. If you want to check out the details, this documentation page might be a good start.
To fix your installation issue you only need to follow the link given in your error message, there's not much need to understand hypervisor workings.

How to get the Android logs remotely?

Because Google told me to, I've been using Log.I , Log.E etc commands throughout my code during development.
This of course has been quite helpful during testing and debugging.
However an application that I have deployed seems to be crashing sometimes, something which I cannot replicate.
Is there a way to retrieve the logs created through the aforementioned commands from the device? I've been through the whole google development site, but there seems to be nothing on the subject (or I am missing something)
Thanks in advance for any help you can provide
Try to look at ACRA and Crashlytics, this tools should help you.

Android screenshot - How to?

Is there any neat way of accessing screenshot of android device
programatically. I am looking for some 15-20fps.
I found one code
android\generic\frameworks\base\services\surfaceflinger\tests\screencap\scr eencap.cpp,
i built the executable and put it in /data and changed the mode 777
but when i tried to execute it using adb shell it gives the below error.
# chmod 777 test-screencap
chmod 777 test-screencap
# ./test-screencap test
./test-screencap test
screen capture failed: Function not implemented
I also know that we can access fb0 but its not a right method as suggested
by android team. Is it possible to access the screen shot at the frameworks
layer. I beleive surface flinger composes individual layers and gives it to
framebuffer.Where exactly this is done ? Can a application be able to access
such codes.
There are some java apps also which use ddms to actually capture this
framebuffer data without root access. But the fps is really poor.
I beleive there should be some or the other way of doing the above job.
Please suggest me some neat way of doing it. Suggestions are welcome.
What you are trying to do is not possible if you don't have a rooted phone, there is an app out there that does what you are trying, Screenshot ER. The latest OEM's are putting it into their /system/apps now... so you may be able to use their apps, check out this article for devices that have enabled this feature. Other than that your really stuck but there are implications with screen captures enabled as this could lead apps saving screen captures and sending that info out, enabling virus type apps...
Information for others .....Through Eclipse you can get a screen capture usig the DDMS perspective. If you take a look at the Eclipse DDMS code base its actually a stand-alone app too. You might be able to use this Java code then.
AdbHelper.getFrameBuffer(AndroidDebugBridge.getSocketAddress(), this);
Take a look at droid VNC Server
This is an open source project which you can clone the source code to your private PC. (http://github.com/oNaiPs/droid-VNC-server). I am investigating how VNC can do but It's really hard to do the same.
Read framebuffer content is an good solution also. But it just work with android <3.x only. I don't know how to fix it to work on android 4.x. If you know how (after see my suggestion) please share it here. Through my researching, I see that there are a lot of people looking for this.
Hope this helps.
nguyenminhbinh1602#gmail.com.
Android Freelancer.

How to get debugging statements for Android in Eclipse

I've read the lame documentation, and checked other answers. I'd like my Android app to print some debug statements in the logcat window of Eclispe. If I use the isLoggable method on the various types of debug levels on the Log class, I find that WARN and INFO are returning true.
Log.w, and Log.i do not produce any output. Does anyone know which gotchas I've missed?
And just to vent, why should this be hard? I've published apps for iphone and bberry and while appreciate the use of java, the platform is reeking of too many "genuiuses" being involved. I suppose Activities and Intents are very flexible, but why? I just want to put up some screens, take some input and show some results. The bberry pushscreen and popscreen is a lot less pretentious.
Thanks,
Gerry
The problem with debugging with Android in Eclipse is that from Eclipse's point of view, you're debugging the emulator and not your specific app. The emulator isn't crashing, so there aren't any logs to show. What you need to use is LogCat, Android's debugging plug-in. See this answer for details on how to bring that up.
It is not clear to me what the problem is. I use "Log.d(TAG, "special message");" all the time in Eclipse in Android code running in the emulator. Since you say "Log.w" gives no output, I assume you already know about the need to import android.util.Log. Otherwise you would not have got even that far.
The only other thing I can think of is for you to check your Eclipse Preferences under Window>Preferences>Android>DDMS (DDMS is needed for Logcat). Make sure the timeout is reasonable (mine defaulted to 5000mS). Make sure the base local debugger port is open, too.

Android read error log from handset

How can I read the error log applications make? Is there any software which reads the error log from the handset and displays it?
I don't want to debug the app using eclipse, I'm looking for a handset based error log viewer.
There are a number of free applications in the Android Market which will collect the device log.
One which looks promising is Log Collector, not least because it is open source. You can find it on Google Code here and on androlib.com here.
Here's another Log Collecting app produced by the creators of Locale.
I quite like the one I wrote ;-)
It's called SendLog
http://l6n.org/android/sendlog.shtml
Alogcat seems OK. It's a bit verbose, though.

Categories

Resources