【问题标题】:sencha build native: build scriptsencha build native:构建脚本
【发布时间】:2014-05-25 14:23:36
【问题描述】:
我正在使用 sencha touch 和 phonegap 为 Android 开发一个移动应用程序。我需要创建用于构建 sencha touch 应用程序并创建 apk 文件的 ant 构建脚本。该 apk 文件应移动到某个位置,以便将应用程序分发给团队。我无法增强 build.xml 文件来执行与 sencha touch 应用程序文件夹中相同的操作。
如何创建构建,它将创建 .apk 文件并移动到某个位置以分发应用程序。
--斯里达
【问题讨论】:
标签:
android
cordova
ant
sencha-touch-2.2
【解决方案1】:
您可以使用 ANT 来创建 android(apk) 构建。您的 build.xml 应包含以下命令的任务
- sencha 应用构建生产
- cordova 构建
您可以使用以下示例来创建 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>
你可以简单地使用“ant build”来执行上面的脚本。
确保您已正确安装 ant 和 cordova。