Linux 에서 CMD 를 이용하여 APK 만들기
- 참고 사이트
- http://i5on9i.egloos.com/4840338 [컴][핸드폰]핸드폰 app 만들기 1/2 - 안드로이드 SDK
- http://i5on9i.egloos.com/4840337 [컴][핸드폰]핸드폰 app 만들기 2/2 - 안드로이드 SDK
- 프로젝트 생성
- activityCreate 어쩌고 저쩌고 - 오류
- 다음과 같이 수정됨.
- http://fightingms.tistory.com/archive/201001
- android create project --target 4 --name Now --path /path/to/my/project --activity Now --package com.commonsware.android
Mine - android create project --target 6 --name HelloWorld --path ./HelloWorld --activity HelloWorld --package kr.co.cubicwave.test.helloworld
- 참고 : cmd> android list targets
결과 | id: 6 or "Google Inc.:Google APIs:7" Name: Google APIs Type: Add-On Vendor: Google Inc. |
- 프로젝트 빌드
- Cmd> cd HelloWorld
- Cmd> ant...
BUILD SUCCESSFUL
Total time: 0 seconds
대략 순서 |
|
- R.java 생성하기
- Cmd> /opt/android-sdk/platforms/android-7/tools/aapt package -m -J src -M AndroidManifest.xml -S res -I "/opt/android-sdk/platforms/android-7/android.jar"
- Cmd > ls -l src/kr/co/cubicwave/test/helloworld/R.java
- Compile *.java
- Cmd> javac -d bin/classes -classpath bin/classes -bootclasspath "/opt/android-sdk/platforms/android-7/android.jar" src/kr/co/cubicwave/test/helloworld/R.java
- Cmd> javac -d bin/classes -classpath bin/classes -bootclasspath "opt/android-sdk/platforms/android-7/android.jar" src/kr/co/cubicwave/test/helloworld/HelloWorld.java
- 달빅용으로 변환하기
- Cmd> /opt/android-sdk/platforms/android-7/tools/dx --dex --output="./bin/classes.dex" --positions=lines "./bin/classes"
- Package 만들기
- Cmd> /opt/android-sdk/platforms/android-7/tools/aapt package -f -M AndroidManifest.xml -S res -I "/opt/android-sdk/platforms/android-7/android.jar" -F bin/Hello.apk
- Cmd> /opt/android-sdk/platforms/android-7/tools/aapt list bin/Hello.apk
결과 | res/layout/main.xml AndroidManifest.xml resources.arsc res/drawable-hdpi/icon.png res/drawable-ldpi/icon.png res/drawable-mdpi/icon.png |
- Sign
- Cmd> apkbuilder bin/Hello-debug.apk -z bin/Hello.apk -f bin/classes.dex -rf ./src -rj ./libs
결과 | Using keystore: /home/cbwdevelop/.android/debug.keystore |
- Cmd> /opt/android-sdk/platforms/android-7/tools/aapt list bin/Hello-debug.apk
결과 | res/layout/main.xml AndroidManifest.xml resources.arsc res/drawable-hdpi/icon.png res/drawable-ldpi/icon.png res/drawable-mdpi/icon.png classes.dex META-INF/MANIFEST.MF META-INF/CERT.SF META-INF/CERT.RSA |
- Emulator Launch
- Cmd> emulator -avd [avd_name]
댓글 없음:
댓글 쓰기