Debug Apache Cordova with Visual Studio Code - visual-studio-code

I have a simple question: can I debug Apache Cordova with VS Code?
I have simple installed and created an app(https://cordova.apache.org/) and then opened the app in VS Code, but I cannot debug it.
Thanks!

First, start up the app on your device / emulator / simulator of choice using. See the TACO CLI docs for help with pre-reqs... running is simple.
To debug, for Android 4.4+, you can just use Chrome Dev Tools. See Chrome documentation on Remote Debugging Devices. This works for Cordova apps too.
For iOS, you can do the same thing from Safari on your Mac. Check "Show Develop menu in menu bar" under Preferences.. >Advanced. Then use the Develop menu to find your device and the cordova app running on it. Be sure to go to Settings > Safari > Advanced and enable the "Web Inspector" option on your device as well.

Yes this is very much possible with the vscode-cordova extension. Install this extension to your VSCode and you should be able to debug the app running on iOS/Android device & simluators/emulators. More details on this is available at the VSCode-cordova github readme.
https://github.com/Microsoft/vscode-cordova

Related

How to connect device over Wifi in VScode on Mac to debug Flutter app?

I would like to be able to use WIFI to debug my Flutter app on VScode. I am using a mac and would not like to use the connection via USB
You can't debug wireless in Visual Studio Code with iPhone and Mac.
You should run your project with Xcode to use the wireless option, but after that, you lose the hot reload option.
So, it's impossible to debug an app with hot reload and wireless at the same time :(
To run the Flutter project with Xcode :
Open your project in VSCode
Click right on iOS folder
Select the Open in Xcode option
Xcode will run your iOS Runner
If you have any errors in Xcode - see this link from the Flutter documentation

Enabling flutter web disables all emulators

When i add flutter web support to a project, any other option like, for ex. launch app on android emulator dissapears(in vs code).
I have not found any sign of trace on official docs about it. It's a bug or there is a way to fix this?
Yes you need to disable web support again to start coding for android/ios. You can do that by this command in your cmd : flutter config --no-enable-web

Get error messages Chrome packaged app

How can I see error messages when running a Chrome packaged app? I've been running the app in the browser and using DevTools but this technique has it's limitations.
If you need to inspect app windows, you can reach them at chrome://inspect/#apps
Or, as Daniel mentions, use the Developer Tool app.
General Chrome Debugging
By opening
chrome://inspect/#apps
you may debug all Apps and Extensions.
You may also like the official Google Chrome Apps & Extensions Developer Tool
Debugging Chrome Extensions
As described in the chrome developer Tutorial you can activate the developer mode within the settings. Afterwards an inspect popup option is avaialbe when you right-click an app-icon.

Troubleshoot Android 4.3 webview within an app that requires up-to-date Google Play services

I need to troubleshoot an issue happening in a webview running within my app. This issue only occurs on Android versions lower or equal to 4.3. My app requires an up to date version of Google Play services.
In order to troubleshoot my webview, I usually can run my app under the Android Emulator (with the latest version of Android), then connect to the web view via Chrome (using chrome://inspect) - the web view appears in Chrome and I'm able to browse the DOM and debug.
To run the app under 4.3, I've created (under AVD) a new device from an existing device definition,
then picked the target Google APIs (Google Inc.) - API Level 18. I've then installed my app, but when trying to run it, I get the error message "This app won't run unless you update Google Play services.". There's an "Update" button on the previous dialog, but nothing happen when clicking on it.
I then tried to debug my issue using Genymotion. I've created a device under 4.3, followed these instructions to flash my device with the latest Google Play services and installed my app. I can now run the app and reproduce the issue within this simulated environment.
The trick now is to be able to connect to the web view from my local Chrome browser. I've enabled remote debugging as described here. Now my device appears in Chrome, but the web view is not showing up in the inspector. Similarly, if I open a new tab under the native browser, it won't show up in the remote inspector. If I open a new tab under Android Chrome though, I can see it showing up under my remote Chrome inspector.
I can see two way moving forward and successfully accessing to the DOM of my webview:
Fixing the "Update" issue under the Android Emulator running 4.3
Or
Connecting to my web view from my Chrome inspector while running the app under Genymotion
Any idea on how to solve one of these two problems?
I have been using weinre for sometimes. it's a pretty good tool to debug webview for android 4.3 and lower. It provides almost same interface as chrome debugger.
All you need to do are:
Install weinre
sudo npm -g install weinre
Client side:
Insert the following code to your webpage <head> section.
Note: it's better to put it at end of <head> section, otherwise there will be some strange errors and debugger won't show up.
<script src="http://<your server ip here>:8081/target/target-script-min.js"></script>
Server side
weinre --boundHost -all- --httpPort 8081
Debugger
open the debugger tool from weinre from your desktop browser:
http://localhost:8081/client/
Finally,
select any target in Targets part and then start debugging.
Remote debugging web views only works on devices with android 4.4 and above.
have a look at this :
https://developer.chrome.com/devtools/docs/remote-debugging

Running the app on Android console Error - Jdeveloper

I am using JDeveloper 11g Release 2. I am trying to run a helloworld code on the Android simulator. But i end up having the following error in the console. This is due to some settings that i have failed to set. Can someone help me to add the settings so i could run the app on the Android Console.
The following Android preference configuration is missing or invalid. Set these options in JDeveloper Preferences on the ADF Mobile panel:
Key and Keystore Password
Android SDK Location
Android Platform Location
(oracle.adfmf.framework.dt.deploy.android.deployers.ValidatePreferencesDeployer)
If you haven't keystore for signing android apps right now as for testing purpose. You should select build mode to Debug rather than Release mode.
Application > Application Properties > Deployment > select your android build profiles or create a new one > Click at Edit button > Android Option > Change Build Mode to Debug
You need to install the Android SDK for Android development and Xcode for iOS development.
FAQ for ADF Mobile: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/adfmobilefaq-1866697.pdf
Here you can find the setup guide for Android :
http://docs.oracle.com/cd/E18941_01/tutorials/MobileTutorial/jdtut_11r2_54_2.html
And the one for iOS :
http://docs.oracle.com/cd/E18941_01/tutorials/MobileTutorial/jdtut_11r2_54_1.html
For Android, make sure your emulator emulates version 4.0 or higher in order to avoid :
The Android emulator emulates ARMv5, which is not supported. The emulator must support ARMv6 or newer
If there is also an error above this stating that it can't write the cwallet.sso try closing Jdeveloper and running as administrator.