このページでは

Androidデバイスでのデバッグ

Qt 5.15.9以降およびQt 6.2以降を使用して開発したAndroidデバイス上のアプリケーションのデバッグには、LLDBを使用できます。

Qt Creator の最近のリリースでは、Android上でLLDBを使用したネイティブ(C++)デバッグに問題がありました。

これは、Qt Creator 17.0.1 で修正されました。それ以前のリリースでこの問題を修正するには、Preferences >Debugger >GDB に移動し、Additional Attach Commands に以下を追加してください。

settings set plugin.jit-loader.gdb.enable off

「デバッガ」環境設定の「GDB」タブ

デバイスでのデバッグを有効にする

Androidデバイスによって、デバッグを有効にする方法は異なります。「Developer Options 」の下にある「USB Debugging 」を探してください。「Settings 」 > 「About 」で「Build number 」を数回タップすると、「Developer Options 」が表示されます。

デバッグビルド構成を選択する

Projects >Build Settings に移動し、Active build configurationデバッグ用ビルド構成を選択して、デバッグ用のアプリケーションをビルドします。

2つ目のデバッガーとの競合を解決する

Qt Creator Android Studio が実行中の場合、Android デバイス上でアプリケーションをデバッグすることはできません。「Application Output」に次のメッセージが表示された場合は、Android Studio を終了して、再度試してください:

Ignoring second debugger -accepting and dropping.

Androidエミュレータの使用

Linux、macOS、または Windows で Android デバイスをエミュレートするには、Android エミュレータを使用します。Android エミュレータは、Android 仮想デバイス (AVD) と呼ばれる仮想マシン上で Android オペレーティングシステムを実行します。

「Android 向け開発の手順」、「 Android 向け開発」、および「デバイス上の開発者向けオプションの設定も参照してください

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.