LoginSignup
6
5

More than 5 years have passed since last update.

libgdx と RoboVM の fork で Java を iOS で動かす

Last updated at Posted at 2016-07-04

libgdx を使ってみたログ

環境

  1. Mac OS X 10.11.5 (英語)
  2. Android Studio 2.1.2
  3. Oracle JDK 1.8.0_91
  4. Xcode 7.3.1

手順

  1. https://libgdx.badlogicgames.com/download.html から gdx-setup.jar をダウンロード
  2. java -jar gdx-setup.jar でプロジェクト作成ウィザードを実行
  3. Android SDK へのパスを指定、Desktop と Html を OFF tmp.png
  4. Advanced ボタンを押して IDEA を ON Screen Shot 2016-07-04 at 19.24.44.png
  5. Save して Generate
  6. Android のビルドツールが新しいすぎる警告が出るが、無視して Yes Screen Shot 2016-07-04 at 19.25.22.png
  7. Android API が新しいすぎる警告が出るが、無視して Yes Screen Shot 2016-07-04 at 19.26.28.png
  8. libgdx-1.9.3, robovm-2.1.0, gradle-2.10 などがインストールされた
  9. Android Studio の Import project で生成された build.gradle を選択
  10. gradle plugin が古いと言われるので Update Untitled.png
  11. これで普通に Android 実機でもエミュレーターでも Run できる
  12. iOS で Run するためには RoboVM Intellij IDEA Plugin が必要
  13. http://robovm.mobidevelop.com/downloads/releases/idea/ から org.robovm.idea-2.1.0-plugin-dist.jar をダウンロードして
  14. Preferences の Plugins の Install plugin from disk でダウンロードした jar を選択して OK Untitled.png
  15. Restart する
    Untitled.png

  16. JDK が古いとエラーが出るが JDK 8 なら OK
    Screen Shot 2016-07-04 at 19.56.08.png

    1. このエラーが出てしまったら Preferences の Plugins で RoboVM Intellij IDEA Plugin を有効にし直す
  17. Run メニューの Edit Configurations... で「 + 」からRoboVM iOS を選択
    Untitled.png

  18. iOS の Configuration が出来上がる
    Untitled.png

  19. そのまま Run すると Simulator で動く(何故か Window が前面に出てこなかったけど)

  20. Attached Device を選んだら iPhone 実機でも動いた

    1. Apple Worldwide Developer Relations Certification Authority 証明書が有効期限切れで No signing identity found matching '/(?i)iPhone Developer|iOS Development/' エラーが出た。
      1. Utilities の Keychain Access で iPhone Developer の証明書を見ると This certificate has an invalid issuer エラーが出てる
      2. https://www.apple.com/certificateauthority/ から WWDR Certificate (Expiring 02/07/23) をダウンロードして Utilities の Keychain Access の System にドラッグ&ドロップしたら直った
    2. No provisioning profile found ... app bundle ID エラーが出たので Xcode で provisioning profile を作り、その名前を ios/robovm.properties の app.id に書いた
6
5
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
6
5