Is there a way to use IntelliJ IDEA and debug apps (step through executing code) while they execute on an android device?
I originally got spoiled using Visual Studio Community. Their integrated editor/debugger let me step through Ionic 1 code as it executed on Android. To me, it was amazing! Then I found others were recommending VS Code which has a smaller footprint, is faster, and with more cordova/Ionic features.Now I can’t go back to VS Community. However, I can’t find any articles on how to make VS Code debug an Ionic 3 app executing on an Android device.
I’m trying to keep an open mind and I’m willing to try just about anything that will make me more productive. I can settle for a work-around to an integrated debugger/editor but stepping through code while it executes on an Android device is a must.
VS Code extension vscode-chrome-debug works with ionic 3 apps. I was able to step through Ionic 3 code via VS Code’s IDE. Its amazing but I was only able to get it to work with Chrome running on my local host. I have not been able to get it to work on an Android device. Here’s my steps for Chrome on the localhost:
Add below line to package.json
"config": { “ionic_source_map”: “source-map” },
Add “Debugger for Chrome” extension, i.e. vscode-chrome-debug
The only thing I could find regarding your question was an excerpt from below post located here.
To get it working, I had to add the --dev switch to ionic:build script in package.json, as suggested in this GitHub issue:
"ionic:build": "ionic-app-scripts build --dev"
Not sure if this is what your looking for. Let me know if you want me to try running it on my device a different way to test.
Ok, I’ve resorted to using the Chrome debugger for my Android device. Steps:
Place the word “debugger” in code for breakpoints
Enter command: “ionic cordova run android –device”
Open Chrome, enter address: “chrome://inspect/#devices”
Select the device running android and trigger whatever fires the breakpoint
This allow me to step through my code but it is not an IDE solution unless I’m missing something.
Questions:
Is it possible to use mapping in Chrome’s debugger so that I can step through my .ts files instead of main.js?
As Ionic 3 is now final, will documentation be updated to show which IDE’s are supported with Ionic 3? Ionic documentation says that VS Code is supported but from what I can tell its not really supported. This would have saved me a lot of time and productivity.
Will there be a chart that lists IDEs by feature? For example, I want a version of Ionic that is supported by an IDE with IntelliSence, error detection, Cordova Tools extensions, Git… If I’d known current IDE’s didn’t support Ionic 3 I would have chosen Ionic 2. I needed to be better educated in making my choice. Again this would have saved me time and productivity.
There is no difference in Ionic support for different versions - the problem is that some of the IDE tools obviously don’t support the current version of Ionic CLI - which is different software… so it is a bit more complicated - as always.
Only if someone decides to start one, I think.
But I started a thread to collect IDEs supporting Ionic (and Ionic CLI) in whatever version, so there is a first rough overview: IDEs integrating Ionic?
By manually, yes if that means I’m doing it through Chrome’s browser. Thank you for all of your help and patience. I’ll be following your IDE’s thread.
Success! Someone wrote a Pull request based on this issue and it got merged: https://github.com/Microsoft/vscode-cordova/pull/280 So now we only have to wait for the next release and it should work with CLI v3