1. #11
    Sencha User
    Join Date
    Feb 2012
    Posts
    44
    Vote Rating
    3
    Answers
    1
    dkamins is on a distinguished road

      0  

    Default


    Quote Originally Posted by tareed View Post
    I am now confused. I think installing SenchaSDKTools-2.0.0-beta2-osx.app installs sencha command. It has a package module (shown in red). I am currently using: sencha app build package and then sencha package build packager.json to build native packages because sencha app build native has a bug that includes my .svn folders in the package. This all seems to work and allows one to use multiple package.json files directly.
    That's basically what I was doing (beginning of thread). But doesn't `sencha app build package` use the packager.json as well? That was my question -- if you're later using a different packager.json file, then how do you know what gets used from which file?

    But I would also like a clarification on whether this is Sencha command or SDK tools. I *think* mitchellsimoens may have been thinking of the `sencha package` from the old SDK tools (because he only uses new `sencha app build native` now), but it sounded like he was saying that the new `sencha package` command somehow runs the old SDK tools?

  2. #12
    Touch Premium Member
    Join Date
    Jul 2011
    Posts
    25
    Vote Rating
    0
    tareed is on a distinguished road

      0  

    Default


    sencha app build package does not appear to use packager.json. I removed it and it builds the same. It is confusing as to what files are used by the sencha command. Also looks like the sencha command is distributed between the install folder and the sdk folder of the app.

  3. #13
    Sencha User
    Join Date
    Feb 2012
    Posts
    44
    Vote Rating
    3
    Answers
    1
    dkamins is on a distinguished road

      2  

    Default This is the best solution I've gotten so far

    This is the best solution I've gotten so far


    This is the best solution I've gotten so far (thanks tareed for the pointers). AFAIK this is entirely using the "Sencha command" (i.e. the new one, not the old one from the SDK Tools).

    1. Start with the Sencha recommended app structure:
    Code:
    sencha generate app ...
    2. Write your app.

    3. If you have extra stuff that needs to go in your final app (beyond images, CSS, etc.), add the paths to the "extras" section of your "app.json" file.

    4. Create a "package" build, ("a self-contained, re-distributable production build that normally runs from local file system without the need for a web server"). This will appear in your ./build/package directory, and you should be able to run it directly with a WebKit browser. You can see exactly what will end up in your final native app (everything here). Note that this step does NOT use any of your packager.json files, which was part of my original issue with "sencha app build native".
    Code:
    sencha app build package
    5. Copy the default "packager.json" into e.g. "my_packager.json". Change "inputPath" from "build/native" to "build/package". You may create multiple JSON files with different options.

    6. Create a signed native packaged app from the package build you just made. This will create something like YourApp.app in the ./build directory. You can drag this file onto the iTunes icon to install it on your device. (You'll have to set up all kinds of wacky certificate/provisioning stuff to do this step, but that's beyond the scope of this thread.)
    Code:
    sencha package build -p my_packager.json
    7. If you made multiple packager JSON files, you can specify any of them in the -p argument, so you could have one that builds for the Simulator, one that makes a Debug build, another Release build, etc. etc. You could also do `sencha app build testing` and have a separate JSON with inputPath that pulls from testing instead, but not sure how useful that would be.

    I hope this helps somebody. Feedback is welcome. As mitchellsimoens shared, if you just want a quick and easy native app build that opens in the Simulator, you can just run `sencha app build native`, but this has some limitations like requiring you to use the single "packager.json" file and popping up the Simulator UI which you might not want.

  4. #14
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    Magnock is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Code:
    sencha app build native
    Should do everything for you if you are using Sencha Command.
    I use this command to generate native packages of some examples that come inside Sencha toucha zip, everything goes "green" until the iOS simulator started, and then blank/white screen on the emulator, I tested all examples, I generated also for android (package.json modification), I also installed a generated apk on my samsung galaxy s2 (AOKP ICS) => Always the blank screen

    Please help.

  5. #15
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Code:
    cd /path/to/sencha-touch-2.0.1 (or 2.0.0 if you don't have 2.0.1)
    sencha app create MyApp /path/to/MyApp
    cd /path/to/MyApp
    sencha app build native
    what does that get you?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #16
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    Magnock is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Code:
    cd /path/to/sencha-touch-2.0.1 (or 2.0.0 if you don't have 2.0.1)
    sencha app create MyApp /path/to/MyApp
    cd /path/to/MyApp
    sencha app build native
    what does that get you?
    Well, this one works well, the app launched without any problem, no blank screen

  7. #17
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you get a blank screen or the loading indicator remains I usually find out that all classes weren't required properly or there was a JS error somewhere.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #18
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    308
    Vote Rating
    22
    Answers
    3
    worthlutz will become famous soon enough

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Code:
    cd /path/to/sencha-touch-2.0.1 (or 2.0.0 if you don't have 2.0.1)
    sencha app create MyApp /path/to/MyApp
    cd /path/to/MyApp
    sencha app build native
    what does that get you?
    on Windows 7: I get "My Application.app" in "build/native" and then it tells me
    Code:
    To run iOS simulator you need to use Mac OS X
    If I modify the packager.json to package for Android it stops after it echos the
    Code:
    [INFO]Packing your application a a native app...
    No further error messages. Just stops...

    The same result if I use
    Code:
    sencha package build -p my_packager.json
    where "my_packager.json" is the modified for Android "packager.json"


    Worth

  9. #19
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    Magnock is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    If you get a blank screen or the loading indicator remains I usually find out that all classes weren't required properly or there was a JS error somewhere.
    I didn't modify any file in sencha examples, here is what I did :
    1 - downloaded and extracted sencha-touch-2.0.0-gpl
    2 - cd /Applications/sencha-touch-2.0.0-gpl/examples/kitchensink/
    3 - sencha app build native
    4 - All [info] green and iOS emulator started
    5 - blank screen

    It's very easy to reproduce if you want to check.

    Thanks

  10. #20
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    308
    Vote Rating
    22
    Answers
    3
    worthlutz will become famous soon enough

      0  

    Default


    Android problem I was having related to
    Code:
    "platform":"AndroidEmulator",
    
    -versus-
    
    "platform":"Android",
    It seems that the AndroidEmulator option described in the packager.json comments does not work.

    Worth