Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Ultimate steps to build a normal ready to store app

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    23
    Answers
    1

    Default Answered: Ultimate steps to build a normal ready to store app

    I have done a sencha app, using sencha cmd and following almost all guide lines sencha reccomends.

    The problem is that I am not finding a definitive clear method to compile the app for android. At some point it is said the sencha cmd will only produce a debug version of the app.

    I can successfully run:
    sencha app build production
    sencha app build android
    sencha app build native
    and so on. I even generated the debug version (with the last version).

    Now if want to generate a definitive ready for store version, what should I do exactely? Is there any tutorial?

    It is supposed that I should merge manually the android build with the cordova folder and then compile with cordova?

    And the next question, if I would need to add some device access function, should I do it when I have this sort of midleware in cordova version?

    PS:
    thanks of all guys of sencha, you have done really a great job saving a lot of time to others developers. Sencha is really really a great framework, not only for the MVC structure in js, but for the cross device compatibility.

  2. Here are the full steps I took to build a final app ready to store:
    Prerequisites:

    For more setting up the env refere here http://docs.sencha.com/cmd/5.x/cordova_phonegap.html

    Steps:
    1. Generate with Sencha CMD your application
    2. Develop , edit your code with you preferred editor
    3. Run and test on a webkit browser with the following:
      Code:
      sencha app build production
      This fase will can reveal bugs and is almost the same version of the app that will run on store. Probably here you can have more errors and bugs that normally one do not see in the developing mode.
    4. Then run this command to create the base directory of cordova project:
      Code:
      sencha cordova init com.mycompany.MyApp MyApp
    5. Run the following command to create the cordova project of the app:
      Code:
       sencha app build cordova
      . This will copy all the files, js, images, resources, css in the cordova directory structure, creating a ready to compile cordova app
    6. (Optional) Open config.xml to edit more data about your app or to add icons and spalsh screens, add platforms, edit name and description
    7. Then access the cordova folder:
      Code:
      cd cordova
    8. Add the Android platform (or any other) to cordova project https://cordova.apache.org/docs/en/4..._index.md.html:
      Code:
      cordova platform add android
    9. For some reason the above command does not copy the sencha app folders in the platform folder. To fix this issue return to sencha app dir (cd ..) and run:
      Code:
      sencha app build native
      which will generate a debug version but will copy the app files in the platform folder
    10. (Optional) In this fase you can add cordova plugins with the following command:
      Code:
      cordova plugin add org.apache.cordova.geolocation
      For finding cordova plugins just go to http://plugins.cordova.io, a great repository
    11. Using the keytool that comes with the Android SDK generate a keystore for the app http://developer.android.com/tools/p...gning-manually:
      Code:
      keytool -genkey -v -keystore myapp.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
      Put this file in separate folder or somewhere.
    12. Create a file called ant.properties inside:
      Code:
      myapp/cordova/platforms/android
      with this content:
      Code:
      key.store=/path_to/app.keystore
      key.store.password=password
      key.alias=alias
      key.alias.password=passwordalias
      This file tells where to find the sign for the store version app
    13. Finally run this command inside the cordova folder:
      Code:
      cordova build android --release

    And the ready to store app will be inside myapp/cordova/platforms/android/ant-build/MainActivity-release.apk

    All these steps worked for me corretly, I was also able to add cordova plugins.
    NOTES:
    - Remember to edit your app.json to define external JS which will be copied.
    - Do not load remote files in app.json for example Google Maps API, you should load them manually inside your app
    - For accented chars (...) use this translator site http://0xcc.net/jsescape/ with html encoding (&#DDDD or the \xXx encoding. Sencha cmd is buggy and will not read UTF-8 in correct way during build
    - If some js file or css file will not be loaded try using
    Code:
    sencha app refresh
    - Be sure to have turn off the private mode browsing on Iphone web testing with safari browser.

    Hope this helps every one, the complete steps for building a signed ready app for store.

    Cheers

  3. #2
    Sencha Premium User Iveco's Avatar
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    105
    Answers
    2

    Default

    I know that you need Android KeyStore+Sign-Key (which you can create using documentation) for Android.
    For iOS you need a Developer-Certificate too, thats mentioned in docs too.
    If you don't do that you can't destribute the app via a store, but you could use-debug mode to get it on local connected to pc devices via iTunes or Android install from unknown sources. But this all later much later when you really go to deployment.

    I would be interested in a tutorial too getting there. For example how to setup local android emulators on windows combined with Eclipse built + Sencha Cmd ? (without manually triggering cmd build native command and uploading the files manually).
    German EXT-User and -Lover :-).

  4. #3
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25

    Default

    look up cordova sencha cmd support.
    ExtJS Websql/Sqlite/IndexedDB/Dynamic proxies: https://github.com/shepsii/extjs-db-proxies

  5. #4
    Sencha Premium User Iveco's Avatar
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    105
    Answers
    2

    Default

    Okay, thanks! I thought Cordova would only be required if I require native OS functionality (like Camera). Or use PhoneGap for this (with its remote building in cloud). But its required for building and starting a simulator too? I thought that would all be included in SenchaCMD.
    German EXT-User and -Lover :-).

  6. #5
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25

    Default

    you now need cordova for any native packaging.sorry for the brief post earlier, had a baby on my lap! You want something like: sencha cordova com.domain.package; sencha app build native
    ExtJS Websql/Sqlite/IndexedDB/Dynamic proxies: https://github.com/shepsii/extjs-db-proxies

  7. #6
    Sencha Premium User Iveco's Avatar
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    105
    Answers
    2

    Default

    No problem ;-). I seem to understand where it goes. I thought because Sencha advertised with "Sencha Mobile Packaging" in the Sencha Complete suite, this would be all done automatically by just using "sencha app build native". But I guess this is not the full story, hence why "sencha cordova init" exists. This wasn't quite sure for me in the documentation (which could also be a lot better for the price). Thanks I will read through this tomorrow!

    Also will take a look at your page from your signature, seems to be a good start too
    German EXT-User and -Lover :-).

  8. #7
    Sencha User
    Join Date
    Oct 2012
    Posts
    23
    Answers
    1

    Default

    I have managed to build a ready to store app. I will publish a full complete guide

  9. #8
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25

    Default

    yes i haven't posted at the blog for a while, sorry! specific first time user issues let me know and i'll write something up. Albanx, if you do write a guide and want somewhere to publish it, let me know!
    ExtJS Websql/Sqlite/IndexedDB/Dynamic proxies: https://github.com/shepsii/extjs-db-proxies

  10. #9
    Sencha Premium User Iveco's Avatar
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    105
    Answers
    2

    Default

    Excellent, that would be great. Thank you both of you!
    German EXT-User and -Lover :-).

  11. #10
    Sencha User
    Join Date
    Oct 2012
    Posts
    23
    Answers
    1

    Default

    Here are the full steps I took to build a final app ready to store:
    Prerequisites:

    For more setting up the env refere here http://docs.sencha.com/cmd/5.x/cordova_phonegap.html

    Steps:
    1. Generate with Sencha CMD your application
    2. Develop , edit your code with you preferred editor
    3. Run and test on a webkit browser with the following:
      Code:
      sencha app build production
      This fase will can reveal bugs and is almost the same version of the app that will run on store. Probably here you can have more errors and bugs that normally one do not see in the developing mode.
    4. Then run this command to create the base directory of cordova project:
      Code:
      sencha cordova init com.mycompany.MyApp MyApp
    5. Run the following command to create the cordova project of the app:
      Code:
       sencha app build cordova
      . This will copy all the files, js, images, resources, css in the cordova directory structure, creating a ready to compile cordova app
    6. (Optional) Open config.xml to edit more data about your app or to add icons and spalsh screens, add platforms, edit name and description
    7. Then access the cordova folder:
      Code:
      cd cordova
    8. Add the Android platform (or any other) to cordova project https://cordova.apache.org/docs/en/4..._index.md.html:
      Code:
      cordova platform add android
    9. For some reason the above command does not copy the sencha app folders in the platform folder. To fix this issue return to sencha app dir (cd ..) and run:
      Code:
      sencha app build native
      which will generate a debug version but will copy the app files in the platform folder
    10. (Optional) In this fase you can add cordova plugins with the following command:
      Code:
      cordova plugin add org.apache.cordova.geolocation
      For finding cordova plugins just go to http://plugins.cordova.io, a great repository
    11. Using the keytool that comes with the Android SDK generate a keystore for the app http://developer.android.com/tools/p...gning-manually:
      Code:
      keytool -genkey -v -keystore myapp.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
      Put this file in separate folder or somewhere.
    12. Create a file called ant.properties inside:
      Code:
      myapp/cordova/platforms/android
      with this content:
      Code:
      key.store=/path_to/app.keystore
      key.store.password=password
      key.alias=alias
      key.alias.password=passwordalias
      This file tells where to find the sign for the store version app
    13. Finally run this command inside the cordova folder:
      Code:
      cordova build android --release

    And the ready to store app will be inside myapp/cordova/platforms/android/ant-build/MainActivity-release.apk

    All these steps worked for me corretly, I was also able to add cordova plugins.
    NOTES:
    - Remember to edit your app.json to define external JS which will be copied.
    - Do not load remote files in app.json for example Google Maps API, you should load them manually inside your app
    - For accented chars (...) use this translator site http://0xcc.net/jsescape/ with html encoding (&#DDDD or the \xXx encoding. Sencha cmd is buggy and will not read UTF-8 in correct way during build
    - If some js file or css file will not be loaded try using
    Code:
    sencha app refresh
    - Be sure to have turn off the private mode browsing on Iphone web testing with safari browser.

    Hope this helps every one, the complete steps for building a signed ready app for store.

    Cheers

Page 1 of 2 12 LastLast

Similar Threads

  1. Production ready - steps
    By sanjay_1985 in forum Ext: Q&A
    Replies: 9
    Last Post: 27 Jan 2014, 5:00 AM
  2. Replies: 1
    Last Post: 6 Jan 2014, 7:06 AM
  3. Replies: 1
    Last Post: 12 Jun 2013, 3:29 PM
  4. What are the Build to App Store Deployment Steps?
    By matdar in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 30 Apr 2012, 12:43 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •