# ペアリングとデバッグ

Monaca Localkit を使用して、Monaca アプリをデバッグする場合、ホスト PC ( Monaca Localkit が実行中であること ) と端末 ( Monaca デバッガーが実行中であること ) のペアリングを最初に行います。

Monaca デバッガーとローカル PC を接続する前に、次の点を確認します。

1. Monaca デバッガーとローカル PC が、同一ネットワーク ( LAN または Wi-Fi ) に接続されていること。公共のネットワークでは、クライアント同士の通信が許可されていないことがあり、その場合には、ペアリングはできません。
2. Monaca デバッガーとローカル PC では、同一の Monaca アカウントを使用すること。
3. ローカル PC 側のファイアーウォールを無効化すること。

## ペアリングの設定

{% hint style="info" %}
iOS 14 以降では、Monaca デバッガー初回起動時に手動でペアリングさせる必要があります。\
&#x20;手動でペアリングする方法については、[ペアリング方法](/products_guide/debugger/troubleshooting.md)を参照していください。
{% endhint %}

1. Monaca Localkit ( ホスト PC ) にログインします。
2. Monaca デバッガー ( 携帯端末 ) にログインします。Monaca Localkit にログインしている Monaca アカウントを使用します。
3. ログイン後、次のように Monaca デバッガーがホスト PC を認識しているか確認します。次に、`ペアリング` をクリックして、ペアリングします。Monaca デバッガーがホスト PC を自動認識していない場合には、 [ペアリング方法](/products_guide/debugger/troubleshooting.md) をご確認ください。

![](/files/-MgVojvUamToraARHTEH)

&#x20;   4\. ペアリング後、Monaca Localkit の \[ デバッガー ] タブ上に、ペアリングされたデバッガーが表示されます。

![](/files/-MgVozFhwCBut6P3JLtq)

&#x20;   5\. デバッガーと Monaca Localkit を接続すると、ローカルに存在するプロジェクトの一覧が、Monaca デバッガー上に、次のように表示されます。

![](/files/-MgVp0D0Bjbrp_NXJ7S8)

## ペアリングの解除

1. Monaca デバッガー画面の左上端に表示された切り替えメニューをクリックして、`ローカルコンピュータ` を選択します。
2. 接続されている PC が表示されます。PC の横に表示されているインフォーメーション アイコンをクリックします ( 下のスクリーンショットを参照のこと )。

![](/files/-MgVp62TWv1Mod7_GhNS)

&#x20;  3\. 接続されている PC の情報が表示されます。`この PC を解除する`  をクリックして、ペアリングを解除します。解除後は、ローカルに保存されている Monaca プロジェクトは、デバッガー上で、デバッグできません。デバッグを再度行う場合には、ペアリングをします。

![](/files/-MgVpA3euGeRPQkyFpH3)

## Monaca Localkit を使用した Monaca アプリのデバッグ

[Monaca 提供のローカル環境用の開発ツールと Monaca デバッガーとの連携](/products_guide/debugger/debug.md) をご確認ください。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ja.docs.monaca.io/products_guide/monaca_localkit/pairing_debugging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
