1
votes

I have an existing Sencha touch project which I would like to deploy on a Windows Phone device. So far I have tried to combine Sencha touch with Phonegap to deploy it via Phonegap, but I did not succeed in doing so.

Since Sencha touch 2.2 Windows Phone support is builtin, according to this post.

Can someone point me on howto deploy an existing Sencha touch project to Windows Phone using Sencha touch 2.2 with Sencha CMD. Any help would be appreciated.

EDIT: For further clarification: By deploying I mean packaging as it is described in the official documentation (there it says that only Android and iOS are currently supported): http://docs-origin.sencha.com/touch/2.2.1/#!/guide/native_packaging

EDIT2: If packaging with Sencha touch is simply not possible as of now, I will be glad to hear about a solution using Phonegap (or something else) to package/deploy an existing Sencha touch app.

2

2 Answers

3
votes

I finally managed to package a Windows Phone 8 app. Using sencha cmd 3.1.2 and cordova 3.0.9 I did the following:

  1. Build a package from existing App using Sencha touch (execute the following in SenchaTouchAppFolder):

    sencha app build package
    
  2. Create new empty Cordova project (execute where your cordova project folder should be placed):

    cordova create ProjectName
    
  3. Add desired platforms (execute in newly created folder [CordovaProjectFolder]):

    cordova platform add wp8
    
  4. Remove all content in CordovaProjectFolder/www except config.xml

  5. Edit config.xml to reflect project settings

  6. Copy/Move content from SenchaTouchAppFolder/build/AppName/package to CordovaProjectFolder/www

  7. Edit index.html add line to include cordova.js in head-Section

    <script type="text/javascript" src="cordova.js"></script>
    
  8. Execute 'cordova build' in CordovaProjectFolder

-> The generated files should be in 'CordovaProjectFolder/platforms/wp8'

0
votes

I managed to package a Windows Phone 8 app using sencha cmd 5.0.0 and cordova 3.5.0 I did the following:

Perform an upgrade to the sencha application (execute the following in SenchaTouchAppFolder):

sencha app upgrade

If the following error message appear

[ERR] org.mozilla.javascript.EcmaError: SyntaxError: illegal character (C:\Sench
a\Sencha\Cmd\5.0.0.160\ant\ant-util.js#605(eval)#1)

Just edit the app.json file and remove invalid characters at beginning of file, then build a package from existing App (run the following command in SenchaTouchAppFolder):

sencha app build native

After creating the cordova project and add the respective platform, if you're using cordova plugins you can install them by, after installing git (execute in newly created folder [CordovaProjectFolder]):

cordova plugin add <URL_GIT_REPO>

Copy/Move content from SenchaTouchAppFolder/build/native/AppName to 'CordovaProjectFolder/platforms/wp8/www'

Finally edit index.html add line to include cordova.js in head-Section.