Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Current »

As you're developing or customizing uMobile, you'll want to test regularly to make sure your app is functioning as expected. The processes and requirements for testing on iOS and Android are very different.

Testing iOS (iPhone and iPad)

As mentioned before, you can only develop and test iOS applications on Mac OSX 10.6.7 (Snow Leopard) or greater. Here are the additional requirements for testing and releasing iOS apps (including testing on a device).

  • An iOS Developer Program Account ($99/year)
  • Xcode with iOS SDK: http://developer.apple.com/xcode/
  • A Development Certificate to sign applications for testing on devices
  • A Development Provisioning Profile to install on devices for testing
  • A Distribution Certificate to sign applications for distribution in the App Store
  • A Distribution Provisioning Profile for submission/distribution through App Store

Setting up iOS Developer Program Account

Visit http://developer.apple.com/programs/ios/ and click "enroll now". During the process, you can select if you'd like to enroll as a company or as an individual. Enrolling as a company will generally make more sense as it allows multiple users to be associated with one account, but it will likely take a few days for Apple to verify information about the company and approve the account. If you enroll as a company, you won't be required to pay the $99 fee until your account has been approved. Individuals should be prepared to pay the fee at the end of the signup process.

Once your account is created, you'll have access to two important tools for iOS development and deployment: iOS Provisioning Portal and iTunes Connect.

Setting up Xcode and iOS SDK

Although most of the development time for uMobile takes place in your own code editor and Titanium Developer, you'll need the iOS SDK to compile apps and will need Xcode occasionally to manage other data. You'll need to be enrolled in the iOS developer program (or Mac OSX Developer Program) before you can download Xcode. Visit https://developer.apple.com/xcode/ to download the IDE bundled with the iOS SDK. The download is about 4.6 Gigs, so be prepared to wait a while. Once Xcode finishes downloading, install it, and you now have the iOS SDK ready to go.

Creating iOS Certificates and Provisioning Profiles

The creation and management of certificates and provisioning profiles can be confusing, but is a necessary part of the process to be able to test on real devices and ultimately submit your app to the App Store. A simple way to think about certificates and profiles is that a certificate pertains to the integrity of one or many applications, whereas a profile pertains to the deployment context (eg. Device, App Store Distribution, Ad-Hoc) of one or many applications. Here are some examples of profiles:

  • Jeff Cross Development Certificate - Personal certificate for signing apps to test.
  • Unicon, Inc. Distribution Certificate - iOS Account-wide certificate for signing apps for distribution
  • Team Provisioning Profile - A shared profile for all users under the same iOS Developer Program account.
  • Jeff Cross iPad Profile - A profile for a specific device.
  • Sakai11 Distribution Profile - A profile used for packaging an app for distribution

For now, you can just worry about settings up a development certificate and development profiles, but eventually you'll need to create a distribution certificate, and separate distribution profiles for each app you want to distribute.

The process for managing certificates and profiles is covered in good detail here: [http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/128-Managing_Devices_and_Digital_Identities/devices_and_identities.html|http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/128-Managing_Devices_and_Digital_Identities/devices_and_identities.html]. Follow the steps outlined there to set up your team for iOS development.

Testing in iOS Simulator

Assuming you've already set up your project in Titanium Developer, you just need to open Titanium Developer, select your project on the left, click the "Test and Package" tab, click the "Run Emulator" tab, select iPhone (default), and then click the Launch button.

The iOS Simulator should open quickly with your app running.

Testing on iOS Device

To test on an iOS device, you first need to have your development certificates and provisioning profiles all squared away on your computer and device, as outlined above.

  1. Just plug your device into your Mac's USB port
  2. In Titanium Developer, Select your project in the left menu
  3. Click the "test and package" tab
  4. Click "Run on Device" and select iPhone (default)
  5. Select the SDK version you'd like to use
  6. Select the development certificate you've installed
  7. Select the provisioning profile with which you'd like to install your app
  8. Hit the "Install Now" button

This should automatically build your app, and install it on your app through iTunes. However, sometimes it will build the app and install it to iTunes but not actually deploy to your app. In this case, you'll need to follow these steps after the application is done building:

  1. Open Xcode, and then from the Window menu select "Organizer".
  2. Select the device you'd like to test with from the left-hand menu
  3. Open iTunes, select "Apps" from the left side to display all of your iOS apps.
  4. Find the newly-built app, right click on it and select "Show in Finder". This will open a finder window to the containing folder of your app
  5. Drag the app from Finder into the Applications list in Xcode organizer.

This will manually install the app on your device.

Now the app is on your device and ready to test.

Leave your device connected to your computer, and watch the "Console" tab in Xcode organizer to see log statements from your app.

Packaging iOS For Distribution

Packaging for distribution involves steps required for testing on a device, but adds some additional steps:

  1. Setting up the app in iTunes Connect
  2. Creating a new Bundle ID
  3. Generating a Distribution Profile
  4. Validating and submitting the app binary through Xcode

Setting up Apps in iTunes Connect

iTunes Connect is where you manage your App Store apps, and information associated with those apps. Features of iTunes Connect:

  • View sales and trends of existing apps
  • Manage users who can access iTunes Connect for this account (for company accounts, not individual)
  • View contracts and financials
  • Manage applications (this is where you upload applications and manage versions of applications)

When you're nearing the time to submit your app for review, you should start the process of submitting your app in iTunes connect. You can start the process even if you're not quite ready to release your app, so that when the app IS ready, all you have to do is upload your binaries.

The process is mostly self-explanatory if you visit itunesconnect.apple.com and click "Manage Your Applications." However, there's a useful guide from Apple here (must login to access): http://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf  
Once you've set up your app, and your iOS app is fully-tested and ready to submit, you'll need to log into iTunes Connect, Manage Your Applications, and indicate that your app is ready for submission so that the status becomes "Waiting for Upload." At this point, you should have created a distribution profile for your app in the iOS provisioning portal. 

Steps for compiling and submitting the app:

  1. In Titanium Developer, navigate to <project> > Test & Package > Distribute > iPhone
  2. Select the iOS SDK version you'd like to target
  3. Select your distribution certificate (if it doesn't show up, try re-downloading from the iOS provisioning portal, or set it up if it hasn't been set up yet).
  4. Select a distribution location. For example, a folder called "release" in your project folder.
  5. Select the distribution provisioning profile. You MUST select the distribution profile that's been associated with the app you're submitting.
  6. Click "Package"

When the process in Titanium is done, it will automatically open Xcode Organizer, focused on the app that was just packaged. 

In Xcode, to complete the final submission of the app:

  1. Select the most recent archive (the packaged version of your app) from the list on the right-hand side.
  2. Click the "Validate" button in the top right part of the window.
  3. You'll be prompted to select the profile to use for validation.If validation passes, click the "Submit" button to upload your app to the App Store.
  4. If upload succeeds, your app status will change to "Waiting for Review," until they start reviewing the app.

If you run into issues during this process, try copying whatever error message you see, and searching for it in the Titanium Developer Q&A site: http://developer.appcelerator.com/questions/

http://developer.appcelerator.com/questions/The amount of time it takes to review apps is unpredictable, but can take anywhere from a week upwards. Make sure to allow time for multiple review rounds for your release, in case the app is rejected the first time.

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

Packaging Android for Distribution

Submitting an Android app is pretty straightforward, and makes your app instantly available in the Android Market. There are just a few steps to get set up and get your app in the Android Market.

  1. Set up an Android Developer account for $25: https://market.android.com/publish/signup
  2. Create a self-signed certificate to sign your application: http://developer.appcelerator.com/doc/mobile/android_markethttp://developer.android.com/guide/publishing/app-signing.html
  3. Compile your app for distribution in Titanium Developer from <project> > Test & Package > Distribute > Android, using the keystore you created in step 2
  4. zipalign your APK http://developer.android.com/guide/developing/tools/zipalign.html
  5. Set up and upload your app in Android Market Developer Console: https://market.android.com/publish/Home

It's possible that there will be issues during the process, but chances are someone else has encountered your same issue and posted a question about it in the Appcelerator Q&A: http://developer.appcelerator.com/questions/. Copy specific error messages and search for them there for a resolution. 

  • No labels