Is there an equivalent API of chrome.debugger in android? - android

chrome.debugger API can be used to communicate between chrome dev tools and chrome debug target. I wonder if there is a equivalent for android app of chrome.debugger, If there is, then I can use it to debug android webviews without physically connect my android device with my development machine.
Thanks.

Related

How to debug android devices in remote desktop in xamarin?

I need to find out how we can debug in xamarin using remote desktop.
I have xamarin installed in my remote machine and my scenario is, I will be using physical device in my local windows machine.
So if I connect the android device in my local machine, it should get detected in my remote desktop and I can also able to debug. How we can achieve this?
Thanks,
How to debug android devices in remote desktop in xamarin?
I am afraid that you cannot get what you want for Visual Studio 2015.
For VS2015, remote debugger cannot debug Xamarin projects.
However, if you have VS2017 or VS2019, you can use RevDeBug VS extension to debug your xamarin project remotely.
You can refer to this tutorial.

Is there a way in Ionic to debug directly on Android or iOS devices?

I'm working on an Ionic/Cordova cross-platform application and I'm struggling a little bit with the debugging.
Debug can of course be done directly from the browser by running ionic serve and then using the browser developer tools, but some behaviors happen only on real devices.
Adding a detailed guide to do this..
Make sure your android device has Developer mode on, and USB debugging is enabled in the developer settings on your device. You can google to activate this.
Device connected via USB, both system and mobile device connected to same wifi network..Use command
ionic cordova run android -l --external
After app has installed and started up on device, open this link in your chrome browser
chrome://inspect/#devices
If all was done correctly, you will see your device name and app name there with an option to inspect. This will open the chrome developer console exactly similar to the web one.
Now you can debug the app right on the device. Add breakpoints, edit html and see the logs as well.
Reference
Yes, you can use Chrome and Safari DevTools to connect to your device and debug the HTML/JS/CSS, as long as you don't build a release version (cordova build android ---release). It does take some initial setup since it's disabled by default.
Or you can use Android Studio or XCode to debug the plugins etc.
Note that you can only debug iOS apps with a Mac (or using Google's iOS WebKit Debug Proxy). Android apps can be debugged from any OS with Chrome (for HTML/JS/CSS) or Android Studio installed.
Official Cordova debugging guide
A simple way could be using logcat, take a look to this answer Debugging a WebView (Ionic) app on Android via logcat.

Android VS Emulator not recognizing work Network

I am trying to set up a selenium/appium framework to test an application on a range of different android devices. As the application is still in the build phase, we are require to be connected to my work network to be able to log into the application itself.
The issue I am having is that if i am using the android VS emulators, I am not able to log into the application.
Whereas if i use BlueStacks to install and run the application, I am able to access the application.
My question is, is here any settings I need to change to make the Android VS emulators to recognize that I am on the work network. Or could you point me in a direction I can investigate?
I am using Appium and the server address is 127.0.0.1:4723.
Why are you using VS Emulator? On this page they state:
Note: After we released the Visual Studio Emulator for Android, Google updated their Android emulator to use hardware acceleration.
We recommend you use Google’s emulator when you can, as it offers access to the latest Android OS images and Google Play services. If you have enabled Hyper-V, try out our Hyper-V Android emulator compatibility preview to run Google’s emulator on Hyper-V directly.
You should use the official Android Studio emulator which lets you control network connectivity:
https://developer.android.com/studio/run/emulator#wi-fi
https://developer.android.com/studio/run/emulator-networking

Android emulator (Genymotion) and proxyfier

The question is if it is possible instead of IP as targets get domains like standard browsers and other windows software provide.
When we use any android emulator. For example Genymotion.
Standard applications
Android emulator

how to enable WebKit's remote debugging/inspector of Android app using WebView?

I need to inspect javascript execution (webview widget) in an android application,
while debugging; through SDK & usb cable and/or http/websockets;
from destop computer (e.g. chrome running on desktop).
Webkit's sources includes DebuggerServer implementation
( platform_external_webkit\Source\WebKit\android\wds\DebugServer.cpp )
accessible at cpp level, and bound if flag WDS is enabled (at build time?)
Source\WebKit\android\jni\WebCoreFrameBridge.cpp:#if ENABLE(WDS)
Source\WebKit\android\jni\WebCoreFrameBridge.cpp: WDS::server()->addFrame(frame);
The default port for server is 9999
The sources show that all is implemented (at Cpp level) to enable the feature,
but I have not found any reference searching the web for experiences
using live debugging at javascript level in adroid devices automating
webkit's inspector interface.
1.- Are the feature present, in binary form, executing in actual android devices?
(has adroid's distribution of webkit been built without WDS flag enabled? :-( )
2.- Can the remote debug feature be enabled/used from javascript or application
(at java level) e.g. at startup of app?
3.- In case it is possible to enable the webkit inspector/debugger feature,
how to make it possible to interact from remote application ? (e.g. from
another javascript app using websockets, or chrome on desktop computers).
Some paragraphs explaining the mechanics like
https://developers.google.com/chrome-developer-tools/docs/remote-debugging#remote
would be nice!
thanks in advance for any information, or references about this topic.
I consider important to enable remote debugging (in the device) at
javascript level to make it possible modern development of HTML5
applications and happy debugging experience.
cheers,
Ale.
For android >= 4.4 (kitkat)
See Remote debugging on Android with Chrome
For android < 4.4 (Lower versions)
Use very good open source tool: weinre. See this video for help to use it.
If you are familiar with grunt then you can use grunt-weinre
For quick view:
install weinre using npm
Do the configuration in your gruntfile.
Run the weinre grunt task.
Use this script to inject the weinre target code into your web page.
Open http://localhost:8082 in your browser and you will find devices running above script. You can debug all this devices.
NOTE: if you want to debug webview/browser in your mobile device then you need to replace localhost with your machine's IP running weinre. And yes, all the devices should be on the same network.
Now it is easy with Android 4.4. See https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews
You can do remote debugging targeting the Android Browser with the weinre project. Or use Chrome remote debugging with the Chrome for Android browser. As far as I know, you can't target a WebView directly, but targeting the Android Browser should get you close.
It cannot be done, because the debugger backend code is not there. The source code you are referencing to is a copy of webkit source in android, but it is not compiled into android release bits.
Pre KitKat jsHyBugger works well ( trial version and annual single user license €29 )
( I have no connection to the developers / have purchased a license )

Categories

Resources