简体   繁体   English

如何在Eclipse中为Android调试javafx应用程序

[英]how to debug a javafx application for android in eclipse

I create a big JavaFX application that works fine in desktop. 我创建了一个大型JavaFX应用程序,该应用程序在桌面上可以正常工作。 In Android, its size is about 20 Mbytes. 在Android中,其大小约为20 MB。

Now, for deploying it for Android, I have installed Gluon (JavaFxPorts). 现在,为了将其部署到Android,我已经安装了Gluon(JavaFxPorts)。 With a small program (using the JavaFX transitions notions, timeline, ...), I have generated an .apk by calling the androidInstall gradle task. 使用一个小程序(使用JavaFX转换概念,时间线等),我通过调用androidInstall gradle任务生成了一个.apk。 That works fine, except I cannot automatically install the .apk file in my phone. 效果很好,除非我无法在手机中自动安装.apk文件。 I do copy/paste from my desktop to my phone. 我确实从桌面复制/粘贴到手机。

BUT, when I want to do the same process with my big application, at the end, my phone screen is already black. 但是,当我想对大型应用程序执行相同的过程时,最后,我的手机屏幕已经黑屏。

Therefeore, even if this big application works fine on my desktop, it is necessary to debug it for Android on my desktop, too. 因此,即使这个大型应用程序在我的桌面上可以正常工作,也有必要在我的桌面上为Android对其进行调试。 But, I don't know how to? 但是,我不知道该怎么办? What to do with apkDebug gradle task, ..? 与apkDebug gradle任务如何处理..? gluon+gradle does not provide a kind of Android emulator that allows to finalize the debug on desktop for a smartphone with its specific features (size of screen, landscape orientation). gluon + gradle没有提供一种Android模拟器,该模拟器无法针对具有特定功能(屏幕尺寸,横向)的智能手机在桌面上完成调试。 Do you agree? 你同意吗?

What is the additional tool that allows to do that? 允许执行此操作的其他工具是什么?

Moreover,when the application is deployed in the smartphone, does it exist a tool that allows to finalize the debug on smartphone? 此外,当应用程序部署在智能手机中时,是否存在允许在智能手机上完成调试的工具?

Thant you for your response 谢谢您的回应

Note: I have installed Android SDK manager and its AVDM in Eclipse, but with the JavaFX use, it is impossible to use it, isn't it? 注意:我已经在Eclipse中安装了Android SDK管理器及其AVDM,但是由于使用了JavaFX,因此无法使用它,不是吗?

Debugging JavaFX projects on Android so far doesn't work on Android emulators. 到目前为止,在Android上调试JavaFX项目在Android模拟器上无法正常运行。

Command Line 命令行

The usual approach is just log messages to the console (ie System.out.println() or Log.v() ...), and then using adb logcat . 通常的方法是将消息记录到控制台(即System.out.println()Log.v() ...),然后使用adb logcat

On command line, go to your Android sdk folder, enter into the platform-tools folder and run adb logcat -v threadtime . 在命令行上,转到您的Android sdk文件夹,进入platform-tools文件夹并运行adb logcat -v threadtime That will give you all the log messages from your device, so you'll need to find your FXActivity pid there and filter through it. 这将为您提供设备中的所有日志消息,因此您需要在其中找到FXActivity pid并对其进行过滤。

Another possibility is using Android's monitor under the tools folder, a GUI tool that will allow filtering the console messages. 另一种可能性是使用tools文件夹下的Android monitor ,这是一个GUI工具,可以过滤控制台消息。

Eclipse 日食

There is an ADT plugin for Eclipse, that can be installed following this question . 有一个Eclipse的ADT插件,可以在此问题之后安装。 This will allow you displaying logCat and device windows among others. 这将允许您显示logCatdevice窗口等。 Basically this will offer the same options as the monitor tool. 基本上,这将提供与monitor工具相同的选项。

However, this doesn't seem to work with recent versions of logcat. 但是,这似乎不适用于最新版本的logcat。

Android Studio Android Studio

You can import your gradle project with Android Studio and enable the Android framework, so you can open the Android Monitor, and easily filter the logcat messages, or switch to the monitor tab with live charts of memory, cpu, ... 您可以使用Android Studio导入gradle项目并启用Android框架,因此您可以打开Android Monitor,轻松过滤logcat消息,或切换到带有实时内存,cpu图表的Monitor选项卡。

Android显示器

Black screen 黑屏

Typically a black screen means you have some exception going on, so you need to use any of the above mentioned logging methods to track it down, solve it and try again. 通常,黑屏表示您有一些例外情况,因此您需要使用上述任何一种日志记录方法来对其进行跟踪,解决并重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM