How is Android app packaged?

Source: Internet
Author: User

After Android app Development is over, you need to package, deploy, and post apps, so how do you package the APK for Android beginners? Today's small series for everyone to share one or two, a look at it ~ ~

AAPT package-m-j src-m androidmanifest.xml-s res-i Android.jar

This command is mainly to re-generate the R.java file automatically, such as adding a picture or a string or adding a layout directory XML file

mkdir D:\testapk\classes

This command is to create a compiled *.java source file output *.class stored directory, folder name can be arbitrarily named.

Javac D:\testapk\src\aimoxiu\theme\moxiutheme\*.java-classpath D:\testapk\android.jar-d D:\testapk\classes\

This command is called the Javac tool to compile the source code, so you want to compile to ensure that the target computer has installed the JDK, the output directory is the directory you just created

CD D:\testapk\classes

Jar CVF Aimoxiu.jar * *

This command is to put the directory under the *.class file into a jar package, in order to later be able to create the APK required Classes.dex file

Cd..

DX--dex--output=classes.dex D:\testapk\classes\aimoxiu.jar

This command converts just the jar package to the Dex file that the Android phone can run.

Createapk.bat File Contents:

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 into the apk file and eventually builds a running APK application

Java-jar Signapk.jar Aimoxiu.x509.pem aimoxiu.pk8 moxiu.apk moxiu_theme.apk

This command is automatically signed for the generated apk, and the unsigned apk is not installed. So an Android app apk is finally baked!

Del moxiu.apk/q

Delete the unsigned apk file that you just generated

Windows operating system implementation without eclipse tools to implement the APK program compiled and packaged using the tool, the generated APK file can also be run on Android Real computer

Linux operating system implementation is not any problem, as long as the command is slightly processed!

AAPT:

AAPT is the acronym for the Android Asset Packaging tool, which is included in the tools/directory of the SDK. View, create, and update zip-compatible archive files (zip, jar, apk). It can also compile the resource file into a binary package.

Although you may not often use appt directly, the build script (build scripts) and IDE plugin will use this tool to package the APK file to form an Android application.

For more detailed use of the details, open a terminal, enter the tools/directory, run the command:

Linux or Mac operating system:./aapt

Windows:aapt.exe

But one thing to note is that the tools/directory refers to the/platforms/android-x/tools/in the Android SDK directory

This is the basic knowledge of Android APK packaging, everyone get these skills?

Related article: "Android Development tools commonly used shortcut keys Daquan"

How is Android app packaged?

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.