How to debug apps on an AVD via a browser - javascript

I am new to coding web apps on Android, and I don't know how to debug apps running in an emulator via a browser. This page: Remote debug Android apps suggests that to debug apps remotely, you need to connect your Android device via USB to the remote system. I am confused as to how to achieve this with an AVD. Has anyone got any answers??
Edit:
I actually posted this question as I was getting "HTTP/1.1 404 not found" whenever I run chrome://inspect/#devices for an AVD, but I wasn't getting same error whenever I run it through my Android device.
However, currently I have found an SO question addressing this issue

Related

Debuging website in native android browser run in AVD(android studio)

I have to debug some problems on website I recently created that occur only in native android browser on some tablets. I don't have access to physical device so I decided to to install Android Studio and created tablet AVD(android virtual device). Process run smoothly and now I can open native browser in virtual device and check my website.
I can see the same errors as those reported on tablets(that's great) but I cannot figure out how to run any kind of devtools in native browser. Even access to console output would be enough.
I'm running android studio on Ubuntu 18.x LTS, but I guess my question is not platform specific.
I would prefer any solution that can be run on virtual device(like some additional app that acts as debugger), even if it would give me only console output, over more sophisticated ones that require more complicated configuration.
But, honestly, I would really appreciate any kind of help.
you have to use the Chrome debug bridge; accessible through chrome://inspect on the desktop browser... connected devices will show up there, as long as USB debugging is enabled; that should work with an emulator, as well.

How can I troubleshoot my website on a Smart TV browser?

We bought a Samsung Smart TV to mount on the wall and display our company dashboard. I wrote the dashboard in HTML/Javascript/CSS and everything is going well. It's to a point that I felt comfortable displaying it on the big screen. However most of the data does not load. I have no idea how to access a console of any type. I've tried changing my agent string to match in Chrome dev tools, but of course that doesn't emulate capabilities. I also downloaded the "2014 Smart TV Emulator 5.1" from Samsung's site and got it running in VirtualBox but as far as I can tell you can only use it to debug and emulate native Tizen apps. I can't figure out how to launch the browser on the emulated set.
So, how can I troubleshoot my web app on a Smart TV Browser?
If you are using Tizen SDK/ Tizen Studio you can debug Tizen web application:
Run As > Tizen Web Simulator Application (Samsung TV)
Click on Web Inspector.
You can see your console here.

Use javascript source-maps with phonegap

we are shipping a Cordova WebApp for tablets with minified source using uglify2-compressor via grunt-contrib-requirejs. We generate source-maps for debugging which work flawlessly using the chrome desktop browser via remote Debugging on a KitKat Android Tablet.
Now we like to send error reports from our customers to our server. The Android WebView does not seem to care about our source maps. Therefore we get error message like "line 1, char 1231231" - not very helpful...
The Question is: Is it possible to use source-maps with the Android (and iOS) Webview maybe using a Cordova plugin or do we have to wait for an update (Chrome and Firefox Desktop are able to parse the maps...) and ship un-minifies code so that we are able to get the line number of the occurred error?
From Chromium discuss topic
DevTools downloads source maps using the front-end browser, not the one that runs the inspected page. So file://android... is never going to be accessible. You need to point to the files on your development box instead.

Web app not working on Chromium in Chrome OS

I'm working on a web app for note-taking called VideoNot.es (http://videonot.es). This app is build with AngularJS and webapp2 and hosted on the Google App Engine.
My app is working fine on Chrome for the major OS (Windows, Mac, Linux) but some users have started to report issues with Chrome OS (mainly teachers with GAFE accounts).
I've decided to run it in Virtualbox and there is effectively an issue.
The app never receives answer send over the Google Channel API (https://developers.google.com/appengine/docs/python/channel/overview) while the backend is logging that it sent it. I had received reports before we moved to it so it is not really link to it.
I really don't understand what is wrong here.
Thanks for your help.
If it's a bug in the Javascript, you'd want to file it on the issue tracker. I haven't noticed much progress on Channel API bugs, so I wouldn't expect much though.
I'd recommend working around it by polling, or another solution, like Node.js hosted elsewhere.

Debugging Web-Applications on Android [duplicate]

I'm developing a JavaScript application that needs to run on the Google Android Phone OS. Is there a way to enable the JavaScript Error/Debug console within Safari on either the Android Emulator or an actual device? If so any instructions on how to do so would be appreciated.
It looks like, with the Android 2.0.1 SDK you'll need to filter on "browser" instead of "WebCore"
A quick Google turns up this blog post (posted after you asked your question), that should at least let you see any Javascript errors via the Android Debug Bridge using the command:
adb logcat WebCore:V *:S
Not quite the same as a full debug console though.
On Android write about:debug on the address line when the current page is the page you want to debug. you will get access to the console.
I know your question is about Safari, but you might want to look into using Chrome instead. You can now use Chrome's desktop developer tools to debug and profile apps on your Android device.
Here's how:
On Android Chrome, go to settings -> Developer tools and check "Enable USB Web debugging"
On the desktop, run adb forward tcp:9222 localabstract:chrome_devtools_remote
Now on Desktop Chrome, navigate to localhost:9222.
You should see a list of the pages you have open on your phone. Click the one you want to debug/profile.
Detailed instructions are here
I have discovered that you can get this debugging information on the phone itself, without needingn to use adb or plug it into a computer, just download a log viewer.
Check the link for more info.
You can view the log and much more with weinre
From the Weinre docs
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.

Categories