Testing on Android

Testing Android

To test on the Android emulator or an Android device, these are the only requirements:

  1. Install the Android SDK: http://developer.android.com/sdk/installing.html
  2. Enable USB Debugging on your device in Settings > Applications > Development...and of course you'll need to plug the device into your computer via USB.

You can deploy your app to the emulator or device through the Titanium Developer GUI. Just navigate to <project> > Test & Package > (Run Emulator OR Run on Device) > Android. When running in the emulator, you can choose the Android OS version, and screen resolution. Whichever version of Android you want to test with, select that version with APIs included (eg. APIs 2.2), so that the maps functionality will work. 

It's recommended to test on lower resolution screens in the emulator so that the emulator will be faster, and so you'll see how the app looks on a smaller screen

Fastdev

Titanium has recently released a tool called Fastdev, which streamlines testing in the Android emulator (and eventually the iOS simulator as well). http://wiki.appcelerator.org/display/guides/Fastdev+Reference+for+Android

Fastdev launches a server to serve your javascript assets to the emulator, rather than packaging them all and deploying them directly to the emulator. As you edit your Javascript, the emulator app reflects your changes immediately. However, most often, you'll need to restart the app in the emulator to see changes take effect. This is much quicker than re-compiling the app entirely though. Here's how to launch Fastdev from command line

  1. cd ~/ProjectRoot (Contains Resources, build, etc)
  2. titanium fastdev start (Make sure titanium is set up as an alias on your machine: http://developer.appcelerator.com/doc/mobile/android/module_sdk)
  3. In a new shell window: titanium run --platform=android

Application should start in emulator. If an emulator doesn't appear, start the Fastdev server (step 2), and then launch the app from Titanium Developer (it will still use the Fastdev server).

When you've made changes to your app and want to see them in the emulator, just type the command: titanium fastdev restart-app which will quickly exit and reopen your app, using files served from the Fastdev server.

Android Device Debugging with DDMS

DDMS, or Dalvik Debug Monitor is an interface that allows monitoring of connected device or emulator logs, so you can see statements from your application as you test on a phone or emulator. If you're testing through Titanium Developer, you'll see the emulator logs already, so DDMS isn't really necessary. However, when testing on your device, DDMS is invaluable. To launch DDMS, just navigate to <android sdk>/tools in your shell, and excute ddms. This will open a window which will show a list of available devices/emulators on the left. Just select the one you want to monitor, and its logs will appear below. You can also view other information about the device and active threads in the top right of the window.

http://developer.android.com/guide/developing/debugging/ddms.html


 Our community can help answer your questions


Create a jira issue for the developers


We welcome our community to assist with our documentation and development efforts.