sencha build native: build script

243 views Asked by At

I am developing a mobile application using sencha touch and phonegap targeting for android. I need to create ant build script used to build sencha touch application and create apk file. That apk file should be moved to some location for distributing the app to the team. I could not enhance build.xml file to do the same which is on the sencha touch application folder.

How do I create build which will create .apk file and move to some location for distributing the app.

--Sridhar

1

There are 1 answers

0
dReAmEr On

You can use ANT for creating android(apk) build. Your build.xml should contain task for below command

  1. sencha app build production
  2. cordova build

you can use below sample to create android build.

<target name="production">      

    <exec executable="cmd" dir="app">
        <arg line="/c 'sencha app build production'"/>
    </exec>
</target>
<target name="build" depends="production">
    <delete dir="${cordova-path}/www"/>
    <copy todir="${cordova-path}/www">
        <fileset dir="app/build/my_app/production" />
    </copy>

    <copy file="${cordova-path}/config.xml" todir="${cordova-path}/www" overwrite="true" />
    <exec dir="${cordova-path}" executable="cmd">
        <arg line="/c 'cordova build'"/>
    </exec>
</target>
<target name="deploy" depends="build">
    <copy file="${cordova-path}/platforms/android/bin/app-debug.apk" todir="." overwrite="true" />
</target>       

and you can simply use "ant build" to execute above script. Make sure you have installed ant and cordova properly.