Debugging Corona Apps on Android Devices (Mac)

The built-in terminal for Corona SDK is great for catching most errors, but some problems just don’t show up until you’re testing on a real device.  Here are the steps needed to show the debug logs for Corona apps on Android devices (these instructions are for development on a Mac).

Note that if you already have the Android SDK downloaded for development you can skip to step 6.

1. Download the Android SDK

http://developer.android.com/sdk/installing/index.html?pkg=tools

2. Unzip the SDK

Double-click the downloaded ZIP file to extract the contents.

 3. Move the folder

The android-sdk-macosx folder can be moved anywhere.  I chose /Users/Shared/android-sdk-macosx

4. Open a terminal window

Click on “Applications”, find “Utilities” and Terminal.  Double-click it to open.

5. Run Android

Type this into the Terminal window and hit return (use your own directory location):

cd /Users/Shared/android-sdk-macosx/tools
./android

This should open the Android SDK manager.  Uncheck all packages except for platform-tools and then install it:

platform-tools

You can then close the Android SDK manager.

6. Run adb

You should now have your cursor back in the Terminal window.  Type these commands:

cd /Users/Shared/android-sdk-macosx/platform-tools
./adb logcat Corona:v *:s

7. Install and Run Your App

Connect a USB cable from your device to your Mac.  Install your Corona app on the Android device and run it.  You should now see debug information in the Terminal window from adb.  If you don’t see any debug logs, make sure that your device shows “connected as a media device” in the notification bar.

In the future, you can open a Terminal and skip to step 6.  If you want to make your life a little easier and save some keystrokes, you could also add the platform-tools directory to your $PATH so you can run adb from anywhere.