{"id":1458,"date":"2013-01-07T15:25:18","date_gmt":"2013-01-07T22:25:18","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=1458"},"modified":"2014-01-28T11:08:25","modified_gmt":"2014-01-28T18:08:25","slug":"command-line-android-development","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2013\/01\/07\/command-line-android-development\/","title":{"rendered":"Command line android development"},"content":{"rendered":"

Eclipse just ate too much CPU and memory resource (thanks Java), so I decided to move to command line android development<\/a>.<\/p>\n

And again, I will keep a copy of steps here so that ease my future lookup:<\/p>\n

    \n
  1. Preparation\n
      \n
    • 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<\/li>\n
    • Downloaded necessary SDK by running “android sdk”<\/li>\n
    • Created necessary virtual devices by running “android avd”<\/li>\n
    • 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<\/li>\n<\/ul>\n<\/li>\n
    • Build\n
        \n
      • 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 …<\/li>\n
      • edit the ant.properties under project root directory, adding two lines like these
        \nkey.store=\/some\/where\/to\/sdk\/android.keystore
        \nkey.alias=release<\/li>\n
      • 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<\/li>\n<\/ul>\n<\/li>\n
      • Install\n
          \n
        • Launch the virtual device first by running “android avd”, select the device then click “start”<\/li>\n
        • 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<\/li>\n
        • Install to the target device by running “adb install bin\/something-release.apk”<\/li>\n<\/ul>\n<\/li>\n
        • Launch\n
            \n
          • Go to the emulator, do whatever you know to launch the app<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n

            With this approach, my laptop’s fan is no longer running like a jet plan …<\/p>\n","protected":false},"excerpt":{"rendered":"

            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:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[236,382,47],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1458"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=1458"}],"version-history":[{"count":2,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1458\/revisions"}],"predecessor-version":[{"id":1652,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1458\/revisions\/1652"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=1458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=1458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=1458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}