How to debug a SIGSEGV on a Mac? - android

I just starting as an Android app developer and I already have a problem with my first app :(
It's a webapp created with jQTouch and packaged with PhoneGap that is on the market for a few weeks. One customer is running it on a Motorola Milestone (Canadian equivalent of the Droid) using Android 2.1 and she says it's crashing.
I tried to reproduce it with the AVD I defined from the following website and I do get a SIGSEGV exception.
http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/
I looked around and I learned that I have to run the log trace in a tool to view the reason behind the crash. I found two tools, stack.py and parse_stack.py, however they require a command to be installed: arm-eabi-addr2line and I don't have it.
Searching again, I found it on GitHub: https://github.com/jsnyder/arm-eabi-toolchain/
Now, trying to install this command, it says I don't have a recent enough version of GCC. I have the latest XCode installed and I think it comes with GCC. Or else it would just say that GCC is not found.
Questions
How do I get this command, arm-eabi-addr2line, installed on my Mac?
Am I doing this for nothing? If stack.py tells me something is wrong in the Android SDK, what can I do to fix my app?
VERY BIG THANK YOU!

You do not debug SIGSEGV crashes unless you are writing your own firmware. Those represent very low-level crashes in Android.
Package up a sample project that demonstrates the crash and upload it to http://b.android.com, along with a list of steps for how to reproduce the crash. Also include there the SIGSEGV crash dump that you are seeing in LogCat.

MacPorts is a great tool for installing anything you might need to debug this as it can install python, and newer versions of gcc for you http://www.macports.org/

Related

How to execute APP downloaded from Google Play in AOSP?

I succeed AOSP build in Nexus 4 and install google apps.
Also, I tried download app from google play and succeed install.
But, When I execute that app, failed execute.
So, check the Logcat I can find 'load .so failed' error in android run time.
Why doesn't working?
Please, how can I find solution this problem?
The short answer is: You probably can't fix this yourself.
The *.so files probably are native running libraries the developer of the app used in his code.
One guess:
Android 5 is capable of 64bit now.
While the Java part of the code works automatically with 64bit, the so-files need to be prepared for it by the developer.
Another guess:
The new ART Runtime causes problems in JNI. For developers, see this: http://developer.android.com/guide/practices/verifying-apps-art.html and
You should contact the developer and ask whether he checked his App on Android 5.

Xamarin apk on Blackberry (>= 10.2.1)

To convert a native Android .apk to a Blackberry .bar does not seem to be a problem.
However, I have an Android .apk (API 15) that I implemented using Xamarin. I am able to convert the file to a .bar file using the BB10 Sideloading Tool, but when I run the app on the Blackberry simulator, I get the error messages:
android_update_LD_LIBRARY_PATH not found; .so dependencies will not work
and later
FATAL EXCEPTION: main java.lang.UnsatisfiedLinkError: Library cannot be found at java.lang.Runtime.loadLibrary(Runtime.java:361)
etc...
I am not really sure what steps can fix this errors.
Is it basically possible to run Xamarin-created .apk-files on Blackberry?
Would it maybe help to turn on the switch "Bundle assemblies into native code" in the Android Build options? For this, I would have to upgrade to Enterprise, but if it helps...
Correct me if I'm wrong, but I'm pretty sure Xamarin works with building your code as a native (as in NDK) library for Android, and a small Java glue to load and run the code from this library.
Two things to note here: the simulator runs a x86 instruction set, when your library is probably built for ARM. Won't work.
For a real device, you'll have to check that every library needed by yours is present on a BB10 device, which is not guaranteed as far as I understand: http://developer.blackberry.com/android/apisupport/android_native_support.html

Eclipse with ADT - JUnit Test Not Running With EclEmma

I am currently running Eclipse Juno with the Android Development Tools plugin so I can develop Android applications and test them. To get code coverage of the applications (and preferably the APIs of Android themselves), I installed EclEmma into Eclipse, but just when I was about to run it for the first time, it gives me an error:
Error while dumping coverage data (code 5013).
Socket closed
I don't know what might be causing this, and when I looked it up here, the workaround didn't seem to work or I'm just not sure where those directories it mentioned are when dealing with the Android SDK. Anyone deal with similar problems?
Latest versions of EclEmma use Jacoco, which as far as I know doesn't support off-line instrumentation.
You should try to find a pre-Jacoco version of EclEmma (it was working just one year ago, http://dtmilano.blogspot.ca/2011/07/eclipse-android-and-emma-code-coverage.html) and try to install it on Juno (very unlikely to work) or stick to the HTML reports, wich can be opened in Eclipse, so it's no such a big problem.

How can I debug an Android app without Eclipse?

I'm currently developing a Scala application for Android. I probably could get by, with the help of many println, but I'm curious if there's a way to debug it with an actual debugger. I am using sbt to build the project, with the jberkel/android-plugin
You may have more luck with IntelliJ IDEA android plugin (free community version has android support, but I'm not sure about scala, full version is available for 30 days)
You don't necessarily need Eclipse to debug your application
In your android/tools directory is a file called ddms - if you start it you get a device overview, a log cat screen for debugging and additional information

Generate core dump in android

I'm developping a android's aplication using some shared
libraries written by me and compiled with ndk-r5b. The application works,
y and the calls to the libraries works too, but I detected some errors,
segmentations faults, and I need to debug it, but, I don't know how debug
native code from android and I don't know if I can generate core dumps,
as in linux, for debug my libraries.
Any idea?
The ndk comes with ndk-gdb, which supposedly allows you to debug native applications. Also, if you download the whole andriod open source project, they also have some version of gdb used for debugging. Look in the docs/ folder of the ndk to learn about using it. This tutorial might also prove helpful: http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/
However, as shown in a recent question I asked: Running ndk-gdb with package not found error on motorola phone I still can't get it to work.
Edit: You said in the comments you were using a Samsung Device: Samsung decide to wreck havoc on some of the crucial internals required for native debugging, but it's easily fixable if you have root access to the device. If you use the --verbose flag, you'll probably find that the error is different than that, a package unknown error. That's because it's looking in /data/system/packages.list, but samsung renamed that file to /dbdata/system/packages.list. So if you make a symlink to that file in /data/system/packages.list, (requires root access) it should work. Or at least so claims the ndk mailing list: http://osdir.com/ml/android-ndk/2011-03/msg00036.html

Categories

Resources