My question is there is a way to debug a specific line of code to check how much memory it takes or a technique of figuring out how much it uses?.
Note* I am using eclipse.
See http://www.droidnova.com/debugging-in-android-using-eclipse,541.html
and
http://macgyverdev.blogspot.de/2011/07/profiling-android-application-tutorial.html
that's all you need to know ;)
Debugging and Profiling are the keywords.
Related
I'm not a developer, so i apologize if I don't phrase the question effectively.
I'm looking for a tool that will help show me what code is being executed as I step through the program. i am not looking to much more than take look under the hood as I test new features & uncover bugs for the new Android app my company is making.
Are there any specific emulators or tools that I could use for this simplistic purpose?
Thanks!
Android Studio has a built-in debugger. See here
There are many ways for to make a debug inside Android Studio.
1-Debug using Logs
2-With logs lines and see on Logcat tool
3-With Breakpoints
and others.
This link its useful for you:
Here
Is there an equivalent of !exploitable for Android? Crashlytics and ACRA does not seem to have exploitability analysis for crashes for Android. Does anyone know of any tool in Android that does it? Please advise thanks.
I know this answer is a bit late, but I hope it can help someone in the future.
There is the exploitable extension for GDB that may be what you are looking for. You can set up GDB in remote debugging mode and connect it to your android application.
any best way to debug exception unless using logcat since the overall code are very big? do u think using break point to view the value if installing apk into actual android phone and running it on the phone via usb cable?
do u think using break point to view the value if installing apk into actual android phone
If this means, 'can you debug using breakpoints on the actual phone?'. The answer is Yes
Here is a tutorial you can follow
The size of the codebase is mostly irrelevant when trying to find the cause of an exception (It might complicate things a little, but in general the procedure is the same as debugging a small application). Debugging is the most efficient way of finding bugs, because you're running directly inside your application and you will not have to speculate about the current state of your application (you can actually look at it).
I suggest that you...
Get familiar with Eclipse debugging
Read the stacktrace
Try to find the exact line in the code where the exception happened (according to the stacktrace)
Set a breakpoint at the exact line or at the beginning of the method
Restart you application and wait until you hit the breakpoint
Inspect the variables using the tools in Eclipse
Hope that helps.
I am writing an android game that involves some c++.
I have a fairly repeatable crash that seems to be due to my c++ code
Looking at the page:
http://source.android.com/porting/debugging_native.html#Debug_Scenarios
(right at the end)
it says to run the output through the "stack tool" - which I can find no trace of.. nor aproto.
I think they're referring to this:
http://code.google.com/p/android-ndk-stacktrace-analyzer/
Don't feel bad about not finding it; it took a lot of searching to track it down the first time. :)
OK - not the nice clean solution Im looking for, but: http://osdir.com/ml/AndroidDevelopers/2009-04/msg00492.html
addr2line - lets me see where Im crashing, in my main loop!
I think I'm not being thread safe...
http://groups.google.com/group/android-developers/browse_thread/thread/73f89bb8739c24bb/5228e7a5dcfff090?lnk=gst&q=stack+tool#5228e7a5dcfff090
It seems the stack tool is an internal google tool (despite being in public docs...)
In most cases, the docs seem to be referring to the ndk-stack tool (even though they call it "the stack tool").
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.