Jan 072013

Eclipse just ate too much CPU and memory resource (thanks Java), so I decided to move to command line android development.

And again, I will keep a copy of steps here so that ease my future lookup:

  1. Preparation
    • Install android SDK, let’s assume you download and unzipped everything to /some/where/to/sdk, and added tools/ and platform-tools/ to PATH already
    • Downloaded necessary SDK by running “android sdk”
    • Created necessary virtual devices by running “android avd”
    • Generate your private key by running “keytool -J-Dfile.encoding=utf8 -genkey -v -keystore android.keystore -alias release -keyalg RSA -keysize 2048 -validity 10000” under the sdk/ directory
  2. Build
    • My project was generated by cordova, so I don’t have to create the project from scratch, but your situation may be different so play with it (android create project) by your own …
    • edit the ant.properties under project root directory, adding two lines like these
    • Above command will generate multiple *-release*.apk under bin/ directory, and the *-release.apk is what we are going to use for installation, assume it is something-release.apk, which “something” should be your app name
  3. Install
    • Launch the virtual device first by running “android avd”, select the device then click “start”
    • Optionally you can choose to wipe user data so that you have a clean start – I occasionally encounted the problem that App on the device was not properly overwritten and if you hit the same problem, you have to do this
    • Install to the target device by running “adb install bin/something-release.apk”
  4. Launch
    • Go to the emulator, do whatever you know to launch the app

With this approach, my laptop’s fan is no longer running like a jet plan …

Sorry, the comment form is closed at this time.