How to debug play2 in idea? - debugging

I found some articles on the internet and some discussions on google group, but they don't work any more.
How to do it with the latest play2-RC3 ?

You can start the play server in debug mode from console [docs], and should be able attach a debugger instance from Idea given that you know the port debugger is listening on.
I haven't use Idea so not sure if it is doable or not. It is fairly easy from netbeans. I suspect, it should be similar from Idea.
EDIT: They have also posted this in their customization guide for IDEs.

Debugging Play 2.x is very easy with IntelliJ IDEA 12.x, here are the steps you have to do:
Step 1. Enable the Play Framework Support plugin and the Play 2.0 Support plugin in File > Settings > Plugins.
The generic plugin usually comes with IntelliJ but make sure it's enabled. The Play 2.0 Support plugin can be downloaded by clicking Install Jetbrains plugin.... Simply locate and install the plugin from the list, the latest working version for 12.x is v.0.2.49. (it may prompt that a Scala plugin needs to be installed aswell)
Step 2. Create a new Play app if you haven't or use an existing one
Step 3. Create a new Debug configuration: Run > Edit configurations...
You can click the + icon in the top left corner to add a new configuration. Simply select Play 2 app from the list and give the configuration a name. The default options should be correct but feel free to change them if necessary. When done, click Apply and Ok.
Step 4. Your toolbar should now have a Run icon and a Debug icon enabled.
Simply click the green arrow to run the Play application. This is the equivalent of doing play run from the commandline (except without the commandline).
To debug, click the green bug, next the the arrow. This is the equivalent of doing play debug from the commandline.
You will now be able to debug when a breakpoint is encountered.
Notes:
Make sure there is only 1 configuration running at a time because Play doesn't like multiple instances running at the same time.
If you're having trouble compiling, do a play clean-all and play package on the commandline, this should resolve most problems. If there are further problems, also try play idea from the commandline.
Make sure the Play configuration is filled in in your settings. You can do this by going to File > Settings > Play Configuration.
A video of these steps can also be found in this video by James Ward (start at around 1:40 min.).

Go to Run -> DEBUG -> Edit Configurations
use "Remote" Configuration and set the Port to 9999

Related

How to allow geopositing in Intellij Idea and apply chrome flags "unsafely-treat-insecure-origin-as-secure"

Is there a way to pass development browser flags in IntelliJ Idea (or WebStorm) ? (as it is in chrome "unsafely-treat-insecure-origin-as-secure" StackOverflow answer)
If I try to get user geolocation with
navigator.geolocation.watchPosition
I get this error and it doesn't allow me to debug my webapp directly from IntelliJ
But I successfully debug it in Chrome in dev tools
Seems to be in IntelliJ there is no place to add dev-flags
Settings (Preferences on macOS) | Tools | Web Browsers
Go there, find your browser (or just create your own custom entry) and add command line arguments or select custom data directory (that points to existing user profile) there.
To ensure that those flags/params will be applied you would need to have that browser closed when launching your Run/Debug Configuration.
In your case you should add --unsafely-treat-insecure-origin-as-secure="http://192.168.1.101:3000" or any other flag separated with a space.

Test in cloud button has gone

I made a 'Xamarin UI Test' Project to test my app.
I was able to click in the button like this: Run in Test Cloud button.
But now i made my test using the Repl() and want to run it in the cloud the button has gone away.
What i have to do to fix it?
Cause of the Issue
It looks like you are hitting this bug: Bug 52372 - "Run in Test Cloud" option no longer appears in menu on C9
That issue is reported on this version for Xamarin 4.3.0.636. Note that it may happen in other versions but this is the initial version the bug was reported against. You can track the status of that issue either directly in the report on Xamarin's bugzilla, and/or you can watch for a release announcement on the Xamarin Releases Blog.
Workarounds
Downgrading Xamarin
While waiting for a fix to become available, you can downgrade to the previous Cycle 8 version of Xamarin by going to “Get the latest stable version of Cycle 8” section on your account page: https://store.xamarin.com/account/my/subscription/downloads#cycle8.
Uploading to Test Cloud via the Command Line
Alternatively, you can upload tests to the Test Cloud through the command line. To do this log into https://testcloud.xamarin.com & click "New Test Run" at the top. (Note this option is only visible if you have a currently valid Test Cloud account or trial.)
This launches a wizard which will have you pick some options (like whether you want to use Android or iOS; etc.), and at the end will generate a prototype command line. Below is an example for Android:
packages\Xamarin.UITest.[version]\tools\test-cloud.exe submit yourAppFile.apk [API_KEY] --devices [DEVICE_HASH] --series "master" --locale "en_US" --user [EMAIL] --assembly-dir pathToTestDllFolder
Note: I have removed the [API_KEY], [DEVICE_HASH] & [EMAIL] values for privacy reasons, however these will automatically be included when you generate the prototype from the wizard in Test Cloud.
You will still have to manually update the Xamarin.UITest.[version] as well as the actual names and relative paths of yourAppFile.apk & pathToTestDllFolder for this approach to work.

Set Dart breakpoints in WebStorm

Dart code execution does not pause at breakpoints set in WebStorm IDE.
The browser config points at a local Dartium install (/home/tom/dart/chromium/chrome-wrapper).
The Chrome extension has been installed.
Clicking on "Debug index.html" in the IDE causes Dartium to be launched. "JetBrains IDE Support is debugging this tab" displays in Dartium.
Any hints as to where to look for a problem?
Edit: I think it's transpiling. Here's the log:
[web] GET /begin/index.html => polymer_and_dart|web/begin/index.html
[web] GET /packages/web_components/dart_support.js =>
web_components|lib/dart_support.js [web] GET
/packages/web_components/webcomponents.js =>
web_components|lib/webcomponents.js
...
There are 2 rather good articles on the topic:
https://medium.com/#kasperpeulen/debugging-dart-in-webstorm-c118c059cca3
https://medium.com/#kasperpeulen/debugging-dart-in-webstorm-part-2-673048da2a3f
While I might not know why exactly you cannot debug your application, reading through these might give you the answer what Kasper (author of the articles) does to make it work.
Download fresh Dartium, set path to it in Settings (Preferences) | Languages and Frameworks | Dart. I'd recommend to update Dart SDK as well.
Check that run configuration for your html file is configured to start in Dartium (Run | Edit Configurations, for historical reasons its type is 'JavaScript Debug Run Configuration').

How to debug firefox extension after cfx run?

I want to debug my firefox extension. I set
javascript.options.showInConsole = true
devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true
run in sdk console cfx run, after that i go to Web Developer -> Browser Toolbox get incoming connection and i see my extension main.js. But after that, the code in main.js already been executed. How to debug it after cfx run?
also, two other things might be messing with your approach:
1) when you use cfx run, that by default creates a new profile on every run, so any settings that you have changed will not persist. to avoid this, you need to specify a profile directory with --profiledir=DIR (warning: don't use your main profile).
2) if the addon main.js code has already run by the time you open the debugger, you should start firefox manually, setup the debugger, and then drag the addon xpi into a tab.
Bug 899054 - [Meta] Implement an Add-on Debugger
this is really close to landing (the UI bits in bug 911098 are in m-c), so if you grab a Nightly tomorrow, or the day after, it should be in there, and might just work (for some undefined value of "work").

Why does WebStorm's LiveEdit not work in Chrome?

I am exploring WebStorm's trial version and would like to use the LiveEdit features.
I am not able to use the LiveEdit features after performing the following actions:
Made sure that LiveEdit is turned on
Installed the Chrome extension
Restarted the browser after installing the extension (I still suspect it is not required)
Run the HTML page in chrome
When I modify the HTML body, I don't see the changes reflected in Chrome.
I read on a forum that netty is not required.
Do we need it?
What else do I need to configure so that I can use the LiveEdit feature?
PS: I am using WebStorm 5.0.
Do you happen to have IntelliJ open by chance?
The point is that the port, 63342, is 'seized' by another app (even if it has nothing to do with HTML debugging).
When the port is busy, LiveEdit tries the next one, 63343. If you right click the JB icon on Chrome, choose Options, increment the port by one, and press Apply, you will magically connect. I wish Jetbrains would have bothered to inform the user what is the port that they are currently attempting to use.
In my PC it happened when I had Mac on. Either one of the following worked:
1. Kill IntelliJ IDEA (that was also open) and try again
2. Increment the port by one as I mentioned above.
I had to go to Run -> Debug (CTRL+F5 on Windows)
What helped in my case was activating "Can accept external connections" under the Settings -> Build, Execute, Deployment -> Debugger
WebStorm Settings
More details as requested:
Installed the JetBrains IDE Extension for Chrome
Make sure the LiveEdit Plugin is installed and activated (Settings -> Plugins)
Make sure "Can accept external connections" is checked (Settings -> Build, Execute, Deployment -> Debugger) AND Port is the same as in the Chrome Extension
Make sure Update ist set to "Auto in (ms)" e.g. 300 (Settings -> Build, Execute, Deployment -> Debugger -> Live Edit)
In my case live edit was just disabled (for some reason)
For anyone googling this thread, LiveEdit is now supported without a plugin. Just go into settings and uncheck "Use JetBrains IDE Support extension for debugging and Live Edit".
Without the extension, the debugging and live edit are more reliable based on my personal experience.
I couldn't make Chrome and Webstorm to link with each other. Chrome plugin was set to 63343 port or something like that.
I am on Windows. I opened command line with administrator privileges and typed:
netstat -a -b
to see all programs and ports they are listening to. I then found first entry regarding WebStorm.exe and saw that it was listening on port 30897. I set that port number in my chrome plugin options, and everything worked.
A quick fix: in the Chrome addon configuration, use the ip 0.0.0.0 for the host.
Turning off the automatic connection configuration from Internet Explorer properties worked for me smoothly. IE is the boss.

Resources