월요일, 7월 12, 2010

[Android] Android builds app(apk) without Eclipse then keystore (Key Sign) & Verify & Deploy

Android builds app(apk) without Eclipse then keystore (Key Sign) & Verify & Deploy


#
# i'm installed JDK, Android SDK, ANT already.
#

# NOTE:
# e.g., base directory: C:/testApp1/
# Your libraries (*.jar) are may need to copy into C:/testApp1/libs/

# STEP1: builds without Eclipse
C:/testApp1> android update project --path C:/testApp1
...
SEE build.xml
...
c:/testApp1> ant
... usage ...
c:/testApp1> ant compile
...
c:/testApp1> ant release
...
SEE testApp1-unsigned.apk into c:/testApp1/bin>
...

# STEP2: Keystore (Key Sign) & Verify




// JDK: keytool, jarsigner

c:/testApp1> keytool -genkey -v -keystore testApp1.keystore -alias testApp1 -keyalg RSA -validity 10000
...
c:/testApp1> jarsigner -verbose -keystore testApp1.keystore bin/testApp1-unsigned.apk testApp1
...
c:/testApp1> jarsigner -verify -verbose bin/testApp1-unsigned.apk
...

# SETP3: Deploy to device
c:/testApp1> adb -d install testApp1-unsigned.apk
...

That's it!



****
Note:

1. keytool Country Code (kr)
 - What is the two-letter country code for this unit?

C:/testApp1> keytool -genkey -v -keystore testApp1.keystore -alias testApp1 -keyalg RSA -validity 10000
...
이 조직의 두 자리 국가 코드를 입력하십시오.
  [Unknown]:  kr
CN=a, OU=a, O=a, L=a, ST=a, C=kr이(가) 맞습니까?
  [아니오]:  y

다음에 대해 유효 기간이 10,000일인 1,024비트 RSA 키 쌍 및 자체 서명된 인증서(SHA1withRSA) 생성 중
        : CN=a, OU=a, O=a, L=a, ST=a, C=kr
에 대한 키 암호를 입력하십시오.
        (keystore 암호와 같은 경우 Enter를 누르십시오):
[testApp1.keystore 저장 중]
C:/testApp1>

2. Files
:: build.properties
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.

# The name of your application package as defined in the manifest.
# Used by the 'uninstall' rule.
application-package=com.test.testApp1
sdk-location=C:/android/android-sdk-windows/platforms/android-7

# hjkim
# KeyStore/Alias
key.store=testApp1.keystore
key.alias=testApp1
key.store.password=MyPassword
key.alias.password=MyPassword

# The name of the source folder.
#source-folder=src

# The name of the output folder.
#out-folder=bin


:: local.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked in Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C:\\android\\android-sdk-window

*** Checks you using SDK Version for deploy
:: default.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.

# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-7



-----
Cheers,
June

댓글 없음:

댓글 쓰기