Let's take a look at the following:
Installation command:
Adb-s emulator-5554install path/to/your/app.apk
The parameters after-s can be viewed through adb devices.
Knowledge is over.
You can use ant to create and compile android projects:
Create a project:
Android createproject-n something-t android-7-p something-k com.
Example. something-aSomething
This creates a something project. The root directory contains build. xml.
When using the project created by eclipse for ant compilation, you need
{Android-sdk-windows} \ tools \ ant \ build. xml
Copy to the project and directory to compile normally. The command is:
Ant debug-the compilation tool has automatically signed the debug key and used zipalign to optimize packaging.
Ant release --- you need to configure the signature and zipalign optimization by yourself. The <project_name> -unsigned.apk file is generated. to automatically sign the file, you also need:
Or add ant. properties under the project root directory:
Key. store = path/to/my. keystore
Key. alias = mykeystore
Or, manually sign and optimize.
Manually generate a signature:
Keytool-genkey-v-keystore my-release-key.keystore-alias alias_name-keyalg RSA-keysize 2048-validity 10000
The keytool is in the following folder:
C: \ ProgramFiles \ Java \ jdk1.6.0 _ 22 \ bin
It should be:
"C: \ ProgramFiles \ Java \ jdk1.6.0 _ 22 \ bin \ keytool"-genkey-v-keystoremy-release-key.keystore-alias alias_name-keyalg RSA-keysize2048-validity 10000
Then you need to sign the file. jarsigner is also in the jdk path:
Jarsigner-verbose-sigalg MD5withRSA-digestalg SHA1-keystoremy-release-key.keystore my_application.apk alias_name
Therefore:
"C: \ ProgramFiles \ Java \ jdk1.6.0 _ 22 \ bin \ jarsigner"-verbose-sigalg MD5withRSA-digestalg SHA1-key store my-release-key.keystore something-release-unsigned.apk alias_name
Then we need to use the zipalign tool in androidsdk for optimization, which reduces the RAM consumption when the device runs the application. Because of alignment, we can directly read mmap () instead of copying all data to the memory:
Zipalign-v 4your_project_name-unaligned.apk your_project_name.apk
Author: houshunwei