programming/phonegap

[phonegap] cordova 적용하기

labj 2016. 11. 7. 19:08


C:\webtools\phonegap>cordova create themiin com.jobtoy.app Themiin

Using detached cordova-create

Creating a new cordova project.


C:\webtools\phonegap>cd themiin


C:\webtools\phonegap\themiin>cordova platform add android

Adding android project...

Creating Cordova project for the Android platform:

        Path: platforms\android

        Package: com.jobtoy.app

        Name: Themiin

        Activity: MainActivity

        Android target: android-24

Subproject Path: CordovaLib

Android project created with cordova-android@6.0.0

Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the pro

ject

Fetching plugin "cordova-plugin-whitelist@1" via npm

Installing "cordova-plugin-whitelist" for android

ANDROID_HOME=C:\Android\sdk

JAVA_HOME=C:\Java\jdk1.8.0_101

Subproject Path: CordovaLib

Incremental java compilation is an incubating feature.

:clean

:CordovaLib:clean


BUILD SUCCESSFUL


Total time: 3.991 secs


               This plugin is only applicable for versions of cordova-android gr

eater than 4.0. If you have a previous platform version, you do *not* need this

plugin since the whitelist will be built in.



C:\webtools\phonegap\themiin>cordova build

ANDROID_HOME=C:\Android\sdk

JAVA_HOME=C:\Java\jdk1.8.0_101

Subproject Path: CordovaLib

Incremental java compilation is an incubating feature.

:preBuild UP-TO-DATE

:preDebugBuild UP-TO-DATE

:checkDebugManifest

:CordovaLib:preBuild UP-TO-DATE

:CordovaLib:preDebugBuild UP-TO-DATE

:CordovaLib:checkDebugManifest

:CordovaLib:prepareDebugDependencies

:CordovaLib:compileDebugAidl

:CordovaLib:compileDebugNdk UP-TO-DATE

:CordovaLib:compileLint

:CordovaLib:copyDebugLint UP-TO-DATE

:CordovaLib:mergeDebugShaders

:CordovaLib:compileDebugShaders

:CordovaLib:generateDebugAssets

:CordovaLib:mergeDebugAssets

:CordovaLib:mergeDebugProguardFiles

:CordovaLib:packageDebugRenderscript UP-TO-DATE

:CordovaLib:compileDebugRenderscript

:CordovaLib:generateDebugResValues

:CordovaLib:generateDebugResources

:CordovaLib:packageDebugResources

:CordovaLib:processDebugManifest

:CordovaLib:generateDebugBuildConfig

:CordovaLib:processDebugResources

:CordovaLib:generateDebugSources

:CordovaLib:incrementalDebugJavaCompilationSafeguard

:CordovaLib:compileDebugJavaWithJavac

:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have ch

anged, no previous execution, etc.).

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:processDebugJavaRes UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForDebug

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug

:CordovaLib:mergeDebugJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

:CordovaLib:bundleDebug

:prepareAndroidCordovaLibUnspecifiedDebugLibrary

:prepareDebugDependencies

:compileDebugAidl

:compileDebugRenderscript

:generateDebugBuildConfig

:generateDebugResValues

:generateDebugResources

:mergeDebugResources

:processDebugManifest

:processDebugResources

:generateDebugSources

:incrementalDebugJavaCompilationSafeguard

:compileDebugJavaWithJavac

:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no p

revious execution, etc.).

:compileDebugNdk UP-TO-DATE

:compileDebugSources

:mergeDebugShaders

:compileDebugShaders

:generateDebugAssets

:mergeDebugAssets

:transformClassesWithDexForDebug

:mergeDebugJniLibFolders

:transformNative_libsWithMergeJniLibsForDebug

:processDebugJavaRes UP-TO-DATE

:transformResourcesWithMergeJavaResForDebug

:validateSigningDebug

:packageDebug

:assembleDebug

:cdvBuildDebug


BUILD SUCCESSFUL


Total time: 24.9 secs

Built the following apk(s):

        C:/webtools/phonegap/themiin/platforms/android/build/outputs/apk/android

-debug.apk


C:\webtools\phonegap\themiin>


C:\webtools\phonegap\themiin>cordova plugin add cordova-plugin-splashscreen

Fetching plugin "cordova-plugin-splashscreen@4.0.0" via npm

Installing "cordova-plugin-splashscreen" for android

ANDROID_HOME=C:\Android\sdk

JAVA_HOME=C:\Java\jdk1.8.0_101

Subproject Path: CordovaLib

Incremental java compilation is an incubating feature.

:clean

:CordovaLib:clean


BUILD SUCCESSFUL


Total time: 4.197 secs


C:\webtools\phonegap\themiin>


C:\webtools\phonegap\themiin>cordova build

ANDROID_HOME=C:\Android\sdk

JAVA_HOME=C:\Java\jdk1.8.0_101

Subproject Path: CordovaLib

Incremental java compilation is an incubating feature.

:preBuild UP-TO-DATE

:preDebugBuild UP-TO-DATE

:checkDebugManifest

:CordovaLib:preBuild UP-TO-DATE

:CordovaLib:preDebugBuild UP-TO-DATE

:CordovaLib:checkDebugManifest

:CordovaLib:prepareDebugDependencies

:CordovaLib:compileDebugAidl

:CordovaLib:compileDebugNdk UP-TO-DATE

:CordovaLib:compileLint

:CordovaLib:copyDebugLint UP-TO-DATE

:CordovaLib:mergeDebugShaders

:CordovaLib:compileDebugShaders

:CordovaLib:generateDebugAssets

:CordovaLib:mergeDebugAssets

:CordovaLib:mergeDebugProguardFiles UP-TO-DATE

:CordovaLib:packageDebugRenderscript UP-TO-DATE

:CordovaLib:compileDebugRenderscript

:CordovaLib:generateDebugResValues

:CordovaLib:generateDebugResources

:CordovaLib:packageDebugResources

:CordovaLib:processDebugManifest

:CordovaLib:generateDebugBuildConfig

:CordovaLib:processDebugResources

:CordovaLib:generateDebugSources

:CordovaLib:incrementalDebugJavaCompilationSafeguard

:CordovaLib:compileDebugJavaWithJavac

:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have ch

anged, no previous execution, etc.).

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:processDebugJavaRes UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForDebug

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug

:CordovaLib:mergeDebugJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

:CordovaLib:bundleDebug

:prepareAndroidCordovaLibUnspecifiedDebugLibrary

:prepareDebugDependencies

:compileDebugAidl

:compileDebugRenderscript

:generateDebugBuildConfig

:generateDebugResValues

:generateDebugResources

:mergeDebugResources

:processDebugManifest

:processDebugResources

:generateDebugSources

:incrementalDebugJavaCompilationSafeguard

:compileDebugJavaWithJavac

:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no p

revious execution, etc.).

Note: C:\webtools\phonegap\themiin\platforms\android\src\org\apache\cordova\spla

shscreen\SplashScreen.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

:compileDebugNdk UP-TO-DATE

:compileDebugSources

:mergeDebugShaders

:compileDebugShaders

:generateDebugAssets

:mergeDebugAssets

:transformClassesWithDexForDebug

:mergeDebugJniLibFolders

:transformNative_libsWithMergeJniLibsForDebug

:processDebugJavaRes UP-TO-DATE

:transformResourcesWithMergeJavaResForDebug

:validateSigningDebug

:packageDebug

:assembleDebug

:cdvBuildDebug


BUILD SUCCESSFUL


Total time: 23.667 secs

Built the following apk(s):

        C:/webtools/phonegap/themiin/platforms/android/build/outputs/apk/android

-debug.apk


C:\webtools\phonegap\themiin>



* icon, splash 파일을 복사해 놓고서

config.xml과 index.html, index.js를 수정하고 

cordova build를 한다.


* 생성된 splash, icon 파일을 platforms\android\res 에 덮어쓰기 한다. 


* cordova run android 로 앱을 실행합니다.