Android - use dx to convert a “.jar” file to a “.dex” file
If you want to use ant with a buld.xml file to one of the operations that needs to be done is to convert a “.class” files to a “.dex”. One way to do this using dx is to convert an entire “.jar” file. The following command converts com.saville.android.debug.jar, a jar file with two classes, Log and Timing, to a dex file:
wink@ic2d1:$ dx –dex –output=classes.dex –locals=full –positions=lines com.saville.android.debug.jar
wink@ic2d1:$ ls -al classes.dex
-rw-r–r– 1 wink wink 3971 2007-12-23 18:50 classes.dex
See dx -help for other parameters, –locals=full and –positions=lines is used because thats what the build.xml file generated by activityCreator.py uses.