Last active
November 3, 2017 22:08
-
-
Save VladimirCores/818a0dbec95e61ffda12bb9c87c659af to your computer and use it in GitHub Desktop.
Ant script to build Android APK (armv7 or x86) and connect it to FDB at specific IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <project name="Application"> | |
| <property name="sdk.air" value="PATH_TO_AIR_SDK_FOLDER"/> | |
| <property name="adt" value="${sdk.air}/bin/adt.bat"/> | |
| <property name="ip" value="192.168.0.101"/> | |
| <property name="project.root" value="."/> | |
| <property name="dir.cert" value="${project.root}/CERTIFICATE_FOLDER"/> | |
| <property name="dir.release" value="${project.root}/RELEASE_FOLDER"/> | |
| <property name="dir.temp" value="temp"/> | |
| <property name="dir.bin" value="bin"/> | |
| <property name="dir.src" value="src"/> | |
| <property name="assets.icons" value="icons"/> | |
| <property name="app.name" value="APPLICATION_NAME"/> | |
| <property name="app.main" value="MAIN_CLASS"/> | |
| <property name="app.descriptor" value="${app.main}-app.xml"/> | |
| <property name="app.id" value="COM_APPLICATION_ID"/> | |
| <property name="air.arch.arm" value="armv7"/> | |
| <property name="air.arch.amd" value="x86"/> | |
| <property name="air.arch" value="${air.arch.arm}"/> | |
| <property name="air.name" value="${app.name}-${air.arch}.apk"/> | |
| <property name="air.storetype" value="pkcs12"/> | |
| <target name="init"> | |
| <mkdir dir="${dir.temp}"/> | |
| <copy todir="${dir.temp}"> | |
| <fileset dir="${dir.bin}"/> | |
| </copy> | |
| </target> | |
| <target name="process" depends="init"> | |
| <exec executable="${adt}" failonerror="true"> | |
| <arg line="-package"/> | |
| <!-- AIR_SIGNING_OPTIONS --> | |
| <arg line="-target apk-debug"/> | |
| <!-- DEBUGGER_CONNECTION_OPTIONS --> | |
| <arg line="-connect ${ip}"/> | |
| <!-- <arg line="-listen 16000"/> --> | |
| <arg line="-arch ${air.arch}"/> | |
| <!-- NATIVE_SIGNING_OPTIONS --> | |
| <arg line="-storetype ${air.storetype}"/> | |
| <arg line="-keystore ${dir.cert}/${app.name}.p12"/> | |
| <arg line="-storepass KEY_PASS"/> | |
| <!-- output --> | |
| <arg line="${dir.release}/${air.name}"/> | |
| <!-- app_descriptor --> | |
| <arg line="${dir.temp}/${app.descriptor}"/> | |
| <!-- FILE_OPTIONS --> | |
| <arg line="-C ${dir.temp}"/> | |
| <arg line="${app.main}.swf"/> | |
| <arg line="-C ${dir.temp}" /> | |
| <arg line="${assets.icons}" /> | |
| </exec> | |
| </target> | |
| <target name="package" depends="process, clean"></target> | |
| <!-- Install on device --> | |
| <target name="install" depends="package" description="Installs the last created .apk file on your attached device"> | |
| <exec executable="adb"> | |
| <arg line="install -d -r"/> | |
| <arg line="${dir.release}/${air.name}"/> | |
| </exec> | |
| <!-- | |
| <exec executable="${adt}"> | |
| <arg line="-installApp"/> | |
| <arg line="-platform android"/> | |
| <arg line="-device"/> | |
| <arg line="${device.id}"/> | |
| <arg line="-package"/> | |
| <arg line="${dir.release}/${air.name}"/> | |
| </exec> | |
| --> | |
| </target> | |
| <!-- Launch on device --> | |
| <target name="launch" depends="install" description="Launches the app on your device"> | |
| <exec executable="${adt}"> | |
| <arg line="-launchApp"/> | |
| <arg line="-platform ${air.platform}"/> | |
| <!-- <arg line="-platformsdk ${android.sdk}"/>--> | |
| <arg line="-appid ${app.id}"/> | |
| </exec> | |
| </target> | |
| <target name="clean" description="clean up"> | |
| <delete dir="${dir.temp}"/> | |
| </target> | |
| </project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Things to replace - ALL_CAPITAL_WORDS:
and of course IP
I suggest that your main class has the same name as output .swf file
And you have icons in a folder