For some reason I cannot install the IPA file on to the iOS8 device using Ant.
I've read countless posts on StackOverflow and searched the world wide web with no luck. Any help appreciated.
I'm on Windows 7 and using Ant to run the command line codes.
Ant Script below:
<macrodef name="install-ios">
<attribute name="ipa"/>
<sequential>
<exec executable="${sdk.home}/bin/adt${bin.bat_ext}" failonerror="true">
<arg value="-installApp"/>
<arg value="-platform"/>
<arg value="ios"/>
<arg value="-package"/>
<arg value="#{ipa}"/>
</exec>
</sequential>
</macrodef>
When I run the script I get an error on the Output:
"exec return 13"
I've tried looking it up, but cannot find anything.
Related
I am trying to create an ant task to execute a maven command, but I am getting error while running the ant task
<target name="Junit">
<exec dir="./MServer/BuildServer/Workspc/CustMgmt" executable="cmd">
<arg value="/C"/>
<arg value="E:\EOM Setup\maven-3.3.9\bin\mvn.bat"/>
<arg value="test" />
</exec>
</target>
While am running this, am getting an error:
'E:\EOM' is not recognized as internal or external command, operable program or batch file
(I am running on Windows 7)
You can get around this issue by using Ant's property task with the location attribute (as opposed to the more common value attribute). This will store the value as a properly formatted path. In addition, you can use this to reference mvn.bat instead of typing out the entire path every time.
<target name="Junit">
<property name="mvn.executable" location="E:\EOM Setup\maven-3.3.9\bin\mvn.bat" />
<exec dir="./MServer/BuildServer/Workspc/CustMgmt" executable="cmd">
<arg value="/C"/>
<arg value="${mvn.executable}"/>
<arg value="test" />
</exec>
</target>
I created an ant build for my cordova project as following:
<project default="build">
<target name="init-android">
<exec executable="cordova">
<arg value="platform"/>
<arg value="add"/>
<arg value="android"/>
</exec>
<exec executable="cordova">
<arg value="build"/>
</exec>
</target>
</project>
But I got this error:
C:\path_to_project\build.xml:3: Execute failed: java.io.IOException:
Cannot run program "cordova": CreateProcess error=2, The system cannot
find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at java.lang.Runtime.exec(Runtime.java:615)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Jav
a13CommandLauncher.java:41)
I can run cordova command with no problem from the command prompt, I have:
JAVA_HOME = C:/Program Files/Java/jdk1.7.0_10/
ANT_HOME = C:\Program Files\Java\apache-ant-1.9.2
NODEJS_HOME = C:\Program Files\nodejs
and they are all in my path. I don't understand why it doesn't work. Please help. Thanks
Generally when working with a Java application to launch programs in Windows, I often have to execute cmd.exe and pass it the full path to the program I actually want to run. This allows system environment variables and such to be set up the way you expect. Try this:
<project default="build">
<target name="init-android">
<exec executable="cmd.exe">
<arg value="/C"/>
<arg value="cordova"/>
<arg value="platform"/>
<arg value="add"/>
<arg value="android"/>
</exec>
<exec executable="cmd.exe">
<arg value="/C"/>
<arg value="cordova"/>
<arg value="build"/>
</exec>
</target>
</project>
If that still doesn't work, give the full path for cordova. An environment variable should work if you have one defined.
I'm trying to install highcharts exporting server(by java). I want to write below maven command line in build.xml file of my project. Not run from cmd.
$ cd highcharts-export/
$ mvn install
How should I do that in build.xml file?
I wrote following in build.xml file and run by ANT. But nothing happens. And idea?
<target name="buildHighchartsExporting" description="Builds highcharts exporting">
<exec dir="${basedir}/highcharts-export" executable="cmd">
<arg value="mvn" />
<arg line="-f highcharts-export/pom.xml install" />
</exec>
<target name="buildWarFile" description="Builds highcharts exporting War">
<exec dir="${basedir}/highcharts-export/highcharts-export-web" executable="cmd">
<arg value="mvn" />
<arg line="clean package" />
</exec>
If you are just trying to execute a project where the pom.xml is at another folder, you can use the -f parameter:
6.1.6. Using a Custom POM or Custom Settings File
If you don’t like the pom.xml file name, the location of your user-specific Maven
settings, or the default location of your global settings file, you
can customize any of these things with the following options:
-f, --file <file>
Forces the use of an alternate POM file
This way, from where you'd execute:
$ cd highcharts-export/
$ mvn install
You can just use:
$ mvn -f highcharts-export/pom.xml install
Running mvn from an ANT build.xml file
You can use the Ant Exec Task:
<target name="buildProject" description="Builds the project">
<exec dir="${source.dir}\${projectName}" executable="cmd">
<arg value="mvn" />
<arg line="-f highcharts-export/pom.xml install" />
</exec>
</target>
Or, more specifically (to your example):
<target name="buildWarFile" description="Builds highcharts exporting War">
<exec dir="${basedir}/highcharts-export" executable="cmd">
<arg value="mvn" />
<arg line="clean package" />
</exec>
Is there any way of launching Windows Explorer from ant without stopping the build?
Here is what I have so far:
<project default="default">
<target name="default">
<fail unless="customerName">
You need to set the customerName.
-DcustomerName=Value
</fail>
<fail unless="htmlCode">
You need to set the htmlCode.
-DcustomerName=Value
</fail>
<exec executable="cmd">
<arg value="-b">
</exec>
<exec executable="explorer">
<arg value='"C:\working_copies\${customerName}\${htmlCode}"' />
</exec>
<exec executable="explorer">
Unfortunately the code above pauses for each window opened and I don't get both my explorer windows at once.
This should work:
<exec executable="cmd.exe"
dir="C:\working_copies\${customerName}\${htmlCode}">
<arg line="/c explorer ." />
</exec>
I can't run the windows 'start' using ant exec. Ant version 1.7.1.
Here is sample build.xml to recreate the problem
<project name="test" basedir="." default="test-target">
<target name="test-target">
<exec executable="start">
<arg line="cmd /c notepad" />
</exec>
</target>
</project>
getting the following error when I execute this build file:
Execute failed: java.io.IOException: Cannot run program "start": Cre
ateProcess error=2, The system cannot find the file specified
My env is Windows XP, Ant 1.7.1
I am trying to run this from DOS prompt.
I rule out any PATH related issues, as I could run 'start cmd /c notepad' from DOS promt manually.
Any suggestions on how to fix this?
cheers
a s
start is not an executable but is an internal command of the cmd.exe shell, so to start something you'd have to:
<exec executable="cmd.exe">
<arg line="/c start notepad" />
</exec>
EDIT:
For spawning multiple windows, this should work:
<target name="spawnwindows">
<exec executable="cmd.exe" spawn="yes">
<arg line="/c start cmd.exe /k echo test1" />
</exec>
<exec executable="cmd.exe" spawn="yes">
<arg line="/c start cmd.exe /k echo test2" />
</exec>
</target>
but you mentioned that spawn="true" is not applicable for your environment, why is that?
my solution
<project name="test" basedir="." default="test-target">
<target name="start-init">
<exec executable="where" outputproperty="START">
<arg line="start" />
</exec>
</target>
<target name="test-target">
<exec executable="${START}">
<arg line="cmd /c notepad" />
</exec>
</target>
</project>
How about <exec executable="start.exe"> ? Or start.bat ?
Also, where is basedir="." pointing to? If you place a <echo message="basedir = ${basedir}"/> just before your <exec> tag, does it print the correct folder (the one with the "start" program in it)?
Additionally, you could add <echoproperties /> before <exec> to see all visible properties.