References.
1. Android Projectd Building System
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + signature + 3zwvcD4KPHA + signature/Signature/WztLPwtTYtcTUtMLrxL/CvM/Signature + signature + PGJyPgo8L3A + signature + Signature = "http://www.2cto.com/uploadfile/Collfiles/20140401/20140401092726118.png" alt = "\">
At this time, the gen directory has no content, and the bin directory is not displayed in the project directory. However, you can view the content on the terminal as follows:
NO content in the classes folder
2. Right-click and Build the Project. The directory structure is as follows:
In this case, the R. java directory is generated under the gen directory, and the bin directory is displayed in the project directory. There is no content shown above. However, the content is changed on the terminal, as shown below:
Only one classes folder is left. This folder is empty.
Corresponding command:
Run the following code in the project directory:
Generate the R file:
Aapt p-f-m-J gen-S res-I ~ /Android-sdk-linux/platforms/android-18/android. jar-M AndroidManifest. xml
3. Right-click and Build the Project again
The bin directory is displayed as above in the project directory. However, the content is changed on the terminal as follows:
In the original classes folder, all class files are generated, such:
Corresponding command:
Run the following command in the project directory:
Generate the. class file:
Javac-encoding GBK-target 1.5-bootclasspath ~ /Android-sdk-linux/platforms/android-18/android. jar-d bin/classes src/com/jltxgcy/helloworld /*. java gen/com/jltxgcy/helloworld/R. java-classpath libs/android-support-v4.jar
4. Right-click Run as Android Application
The bin directory is displayed as above in the project directory. However, the content is changed on the terminal as follows:
AndroidManifest. xml-F bin/resources. ap _
Generate classes. dex:
Dx -- dex -- output = bin/classes. dex bin/classes
Generate helloworld_unsigned.apk:
Apkbuilder bin/HelloWorld_unsigned.apk-v-u-z bin/resources. ap _-f bin/classes. dex-rf src-nf libs
Sign the apk and use the debug key. The alias is androiddebugkey and the password is android:
Jarsigner-verbose-keystore ~ /. Android/debug. keystore-signedjar bin/HelloWorld_signed.apk bin/HelloWorld_unsigned.apk androiddebugkey
Align apk:
Zipalign-v 4 bin/HelloWorld_signed.apk bin/HelloWorld.apk
Remove temporary apk:
Rm bin/HelloWorld_unsigned.apk bin/HelloWorld_signed.apk
Install apk:
Adb install bin/HelloWorld.apk
5. Right-click Android Tools> Export Signed Application Package
In the same step, only the self-created digital certificate (release version) is signed, and the last apk is not saved in the bin directory, but specified by the user.
See http://blog.csdn.net/jltxgcy/article/details/22647101 for details