Android crash reports. Detailed. Fast. Direct to your inbox. Why?
Acracadabra is a Rails app that receives ACRA-generated crash reports from Android applications and passes them directly to your email inbox. What's ACRA?
...a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. It is targetted to Android applications developers to help them get data from their applications when they crash or behave erroneously.
[It] can be used with your own self-hosted report receiver script.
Acracadabra is a fast-pass to your own "self-hosted report receiver script."
Follow the steps below. You can be up and running in under 20 minutes.
- See the Gemfile
- Ruby 1.9.3
- Rails 3.2.8
- Heroku Toolbelt
If you do not have a GitHub account, you can download the source. Otherwise, fork this repo:
-
Checkout the source
$ git clone git@github.com:<your_account>/acracadabra.git $ cd acracadabra
-
Install dependencies:
$ bundle install
-
Set up RSpec
$ rails generate rspec:install
-
Run unit tests:
$ rspec
-
Specify 'from' address and report recipients in the
.env
file. Example:FROM_ADDRESS=jeremy@livefront.com RECIPIENTS=jeremy@livefront.com
-
Fire it up:
$ foreman start
Foreman is used because of its ability to easily set environment variables with the
.env
file. -
Confirm the dev server is running and configured properly
Load
http://localhost:5000
in your browser.
-
Create the app
$ heroku create --stack cedar
-
Add Heroku add-on(s)
$ heroku addons:add sendgrid:starter
-
Set Heroku config variable for report recipients
$ heroku config:add FROM_ADDRESS=<email_address> $ heroku config:add RECIPIENTS=<email_address>
-
Deploy to Heroku
$ git push heroku master $ heroku ps:restart
-
Confirm configuration
$ heroku open
-
[Optional] Disable the welcome page in production
1. In `config/routes.rb`, change this:
root :to => 'welcome#home'
# root :to => 'welcome#not_found'
to this:
# root :to => 'welcome#home'
root :to => 'welcome#not_found'
- Download the ACRA library
- Extract the ZIP
- Copy the
build/acra-<version>.jar
file to<android_app_root>/libs
-
If you do not already have an Application subclass, create one:
import android.app.Application; public class MyApplication extends Application { }
and update
AndroidManifest.xml
to use your new Application subclass:... <application android:icon="@drawable/icon" android:label="@string/app_name" android:name="MyApplication"> ...
-
Add the
ReportsCrashes
annotation to your Application subclass.formKey
will be ignored. Set the value offormUri
to thereports
path of your acracadabra service.... import org.acra.ACRA; import org.acra.annotation.ReportsCrashes; ... @ReportsCrashes(formKey = "", formUri = "http://<acracadabra_hostname_and_port>/reports") public class MyApplication extends Application { }
-
Initialize ACRA in
onCreate()
@Override public void onCreate() { ACRA.init(this); super.onCreate(); }
-
If your
AndroidManifest.xml
does not already request theINTERNET
permission, add it:<uses-permission android:name="android.permission.INTERNET"/>
-
That's it! See the ACRA documentation for advanced configuration options. If you want to test a crash report, you can do something simple like throwing a RuntimeException in
onResume()
of one of your activities:@Override onResume() { throw new RuntimeException("And we're done."); }
Acradabra is released under the MIT license.
Copyright (c) 2012 Livefront, Inc.