LoginSignup
1
3

More than 3 years have passed since last update.

RPGツクールのPKGをAPK化する多分一番簡単な方法

Posted at

RPGツクールPKG -> APK化まとめ

PWA化するぜーっていう話じゃなくてRPGツクールを横展したいという要望を会社から受けたので調べてみた。

材料

準備

  1. Cordova インストール
  2. JDK(Java development kit) インストール

  3. Android Studio ( or Grandle 単体 )インストール
    https://developer.android.com/studio (Grandle単体は未検証)

  4. grandle向け環境PATH設定

    1. 必要に応じてgrandleのパーミッションの修正(EACCESエラーが出たときのみ) https://qiita.com/bathtimefish/items/7304f11ba4bbb36fd02d

ビルド

  1. アプリ新規作成

    $ cordova create <app-name>
    $ cd <app-name>
    # /www配下にアプリ化したいゲームのアセットをすべてぶちこむ。
    # その際に/js/index.jsを上書きしないように注意
    
  2. プラットフォームの追加

    $ cordova platform add android
    
  3. ビルド事前チェック

    $ cordova requirements
    

    errorがでなければ次へ

  4. apkビルド

    $ sudo cordova build android
    #パーミッションでエラーが起きる可能性があるので管理者権限(もしくはsudo)でビルド
    
  5. 完成
    こんな感じのPATHにビルドされたapkが出てくる
    /Users/*****/develop/cord/MyApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk

  6. サーバーアップロード
    FTPサーバーにapkファイルをおいてAndroidからアクセスしてDL

(参考)ビルドログ

ukei1986:MyApp *****$ sudo cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/*****/Library/Android/sdk (DEPRECATED)

Welcome to Gradle 5.1.1!

Here are the highlights of this release:
 - Control which dependencies can be retrieved from which repositories
 - Production-ready configuration avoidance APIs

For more details see https://docs.gradle.org/5.1.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 4s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Downloading https://services.gradle.org/distributions/gradle-4.10.3-all.zip
................................................................................................................

Welcome to Gradle 4.10.3!

Here are the highlights of this release:
 - Incremental Java compilation by default
 - Periodic Gradle caches cleanup
 - Gradle Kotlin DSL 1.0-RC6
 - Nested included builds
 - SNAPSHOT plugin versions in the `plugins {}` block

For more details see https://docs.gradle.org/4.10.3/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest
> Task :CordovaLib:processDebugManifest
> Task :app:preDebugBuild
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript
> Task :app:checkDebugManifest
> Task :app:generateDebugBuildConfig
> Task :app:prepareLintJar
> Task :app:generateDebugSources
> Task :CordovaLib:compileDebugRenderscript
> Task :CordovaLib:generateDebugBuildConfig
> Task :CordovaLib:generateDebugResValues
> Task :CordovaLib:generateDebugResources
> Task :CordovaLib:packageDebugResources
> Task :CordovaLib:generateDebugRFile
> Task :CordovaLib:prepareLintJar
> Task :CordovaLib:generateDebugSources
> Task :CordovaLib:javaPreCompileDebug

> Task :CordovaLib:compileDebugJavaWithJavac
Note: /Users/*****/develop/cord/MyApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
> Task :app:javaPreCompileDebug
> Task :app:mainApkListPersistenceDebug
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:processDebugManifest
> Task :app:processDebugResources
> Task :app:compileDebugJavaWithJavac
> Task :app:compileDebugNdk NO-SOURCE
> Task :app:compileDebugSources
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders
> Task :app:generateDebugAssets
> Task :CordovaLib:mergeDebugShaders
> Task :CordovaLib:compileDebugShaders
> Task :CordovaLib:generateDebugAssets
> Task :CordovaLib:packageDebugAssets
> Task :app:mergeDebugAssets
> Task :app:validateSigningDebug
> Task :app:signingConfigWriterDebug
> Task :app:transformClassesWithDexBuilderForDebug
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug
> Task :app:transformDexArchiveWithDexMergerForDebug
> Task :app:mergeDebugJniLibFolders
> Task :CordovaLib:compileDebugNdk NO-SOURCE
> Task :CordovaLib:mergeDebugJniLibFolders
> Task :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug
> Task :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug
> Task :app:transformNativeLibsWithMergeJniLibsForDebug
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForDebug
> Task :app:packageDebug
> Task :app:assembleDebug
> Task :app:cdvBuildDebug

BUILD SUCCESSFUL in 1m 33s
42 actionable tasks: 42 executed
Built the following apk(s): 
        /Users/*****/develop/cord/MyApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3