Android APK program compilation and packaging tools are not required for Windows systems.

Source: Internet
Author: User

Address: http://www.eoeandroid.com/thread-25121-1-1.html

Today, I have developed a tool for packaging APK. I will share with you the example and upload it as an attachment for your reference. I hope this will help you.
The attachment contains two bat batch processing files. I will explain the commands here and share them with you.
Content of the createdex. BAT file:
Aapt package-m-J Src-M androidmanifest. XML-s res-I android. jar // This command is mainly used to automatically generate the R. java files, such as adding images or strings or adding XML files in the layout directory
Mkdir D: \ testapk \ Classes // This command creates a directory for compiling *. Java source file output *. class. The folder name can be named at will.
Javac D: \ testapk \ SRC \ aimoxiu \ theme \ moxiutheme \ *. Java-classpath D: \ testapk \ Android. jar-D: \ testapk \ Classes \
// This command calls the javac tool to compile the source code. Therefore, make sure that the JDK has been installed on the target computer. The output directory is the one just created.
Cd d: \ testapk \ Classes
Jar CVF aimoxiu. jar *. * // This command is to compress the *. Class file in the Directory into a jar package, in order to create the classes. Dex file required by the APK later
CD ..
DX -- Dex -- output = classes. Dex D: \ testapk \ Classes \ aimoxiu. Jar // This command converts the jar package to the DEX file that can be run on the Android phone.
Content of the createapk. BAT file:
Aapt package-z-u-X-F-M androidmanifest. XML-s res-I Android. jar-F moxiu.apk // This command generates the application APK File
Aapt add moxiu.apk classes. Dex // This command compresses the previously generated classes. Dex file to the APK file, and finally generates a runable APK Application
Java-jar signapk. Jar aimoxiu. x509.pem aimoxiu. pk8 moxiu.apk moxiu_theme.apk // The command automatically signs the generated APK, And the unsigned APK cannot be installed. So an Android Application APK is finally released!
Del moxiu.apk/Q // Delete the generated unsigned APK File

For Windows operating system implementation, you do not need to use the eclipse tool to compile and package the APK program. I have passed the test and the generated APK file can also be run on the android real machine. For the tool, see the attachment.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.