LoginSignup
62
63

More than 5 years have passed since last update.

【IntelliJ】Scala/PlayFrameworkをIntelliJでデバッグする【Play】

Last updated at Posted at 2014-04-06

注意:IntelliJは13.1(2014/4/6 時点のEAPです。)、PlayFrameworkは2.2.2でございます。

あんまり有用な情報ではないですが、手順書づくりの一環で作っています。
知っている人はスルーしてください。

PlayFrameworkを入れる&アプリを作る

play consoleでアプリを作ってください。
アプリ作成後、play consoleで、IntelliJ用の設定ファイルを生成しましょう

> idea

IntelliJの設定

開発マシンにIntelliJを入れてください。
Ultimate版はPlay 2プラグインもあるので幸せになれるかも

前述で作ったアプリで、play console で idea を実行していれば、すでにそのアプリはIntelliJのプロジェクト扱いなので、IntelliJのファイルメニューのOpenから開けます。開いてください。

デバッグ設定

下矢印を押すと、Edit Configurationsって出てくるので押してください。

lepus_kanaloco_-____Development_PHP_lepus_kanaloco__-_IntelliJ_IDEA__Cardea__IU-135_666.jpg

新しい設定を作るので、左上のプラスボタンをクリック、Remoteをクリックします。

Run_Debug_Configurations_と_lepus_kanaloco_-____Development_PHP_lepus_kanaloco__-_IntelliJ_IDEA__Cardea__IU-135_666.jpg

クリック直後

Run_Debug_Configurations.jpg

任意のデバッグ名称をつけ、ポートを9999にします

Run_Debug_Configurations.jpg

OKを押してください。
これで準備完了です。

デバッグ開始

$ play debug
> run

で起動します。
play console の立ち上げ時に、play debugで立ち上げてください。

IntelliJの、先ほどの下矢印のところに作った名称が出ていると思うので、それが選択されている状態で、虫アイコンをクリックするとデバッグ開始です。

lepus_kanaloco_-____Development_PHP_lepus_kanaloco__-_IntelliJ_IDEA__Cardea__IU-135_666.jpg

ブラウザで http://localhost:9000 にアクセスして、ブレークポイントを貼ったあたりに止まってくれれば成功です。

デバッグ中は↓みたいな感じです。

Top_scala_-__twigs__-_twigs_-____Development_Scala_twigs__-_IntelliJ_IDEA__Cardea__IU-135_666.jpg

以上。

62
63
1

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
62
63