Problems with remote debugging an Android app on my phone - android

I am developing a cordova Android application and want to remote debug it.
When I start my app on my Android phone thats connected to my Mac I can see the device and the inspectable app webview on Chrome's
chrome://inspect/#devices - page.
But whenever I click on the 'inspect' link a window opens and at once closes again.
I double checked the android:debugable-flag is set to true in AndroidManifest.xml application element and my device is set to be able to use USB-debugging. I use cordova version: 3.5.0-0.2.6.
Really don't know what went wrong.
Any help is appreciated.

I just found the answer today after searching the web again. I got to the following document:
Google remote debugging webviews
I just had to make sure I use:
Chrome Canary browser for debugging
instead of the normal Chrome browser. I test it and debugging works like a charme.
Just posted this answer for those which got a similar problem since nobody answered me.

Related

Google Chrome Developer Tools : Android Debugging returns HTTP/1.1 404 Not Found. Why?

This was working fine up until yesterday. Now when I connect my Android device for USB Debuggers. Chrome is no longer display my app.
Now the popup window shows HTTP/1.1 404 Not Found.
Looks to be connecting fine and the app runs fine on my Mobile Device.
Solution was to access through chrome://inspect/#devices
Then select the "inspect fallback" option.
This is because the remote browser was newer than the client browser.
Use VPN in both mobile and your computer.
It is maybe because of google restricted this feature in your country.
This problem just showed up on the latest released version of Chrome 72.0.3626.76 (will they ever add a regression test?).
None of these answers were completely satisfying.
I was stuck with the same version on both Android and my desktop so "inspect fallback" is not showing on the UI.
I tried to uninstall chrome from Android but that option is not available in Android 8.1?
Here is how you can workaround those issues and get back to debugging.
Workaround:
The objective of this workaround is to get the desktop version different than the device version so that you can see the inspect fallback option.
disable chrome updates. Instructions for Windows
uninstall latest Chrome on desktop.
install previous version: e.g. 71.0.3578.80 (using slimjet)
Open chrome://inspect/#devices url and choose inspect fallback instead of inspect.
Debugging restored!
Workaround 2:
As Asaf points out in the comments another way to get the versions to be different is to use the EDGE browser which is now based on Chromium. As long as the versions are different then the inspect fallback option should show up.
PS: I think this bug is still active in the canary channel so it may be a while before it gets fixed.
Here is the chromium bug.
UPDATE 3/6/2019
Looks like this is fixed again on version 72.0.3626.121 (maybe earlier builds)
I did not have a fallback option at chrome://inspect/#devices, but I was able to fix it by uninstalling chrome updates on my Android device, as this is caused by the most recent update for android's chrome.
Go to Chrome's App Info, press the 3 dots in the top right corner and then click uninstall updates.
Open https://chrome-devtools-frontend.appspot.com. If it returns 502, then it is maybe a host error.
I have suffered this problem, cause the Google API has been blocked. If you are in mainland China, the GFW may be the reason. So, using VPN may be helpful.
In my case it was because port 8080 was not enabled
open link chrome://inspect/#devices
select "Port Forwarding"
add "localhost:8080"
Just turn on your VPN if you are in a restricted country.
And don't tunnel your whole device so you can debug your web app over the network. Just use a chrome extension VPN.
Got around this by disabling Chrome on my phone, the latest version has a bug. This forces your app to use the webview version that shipped with your phone.
i have updated to the latest desktop chrome version and now it works. not having white screen anymore. my current version : Version 73.0.3683.75 (Official Build) (64-bit).
i forgot to note down my previous version so i can't
Solved the issue uninstalling Chrome updates on my phone by following answer above: pressing the 3 dots in the top right and then clicking uninstall updates.
Another solution is to use Chrome Beta instead of Chrome on your mobile device. It has the Inspect Fallback option on version 97.0.4692.20
If you live in Iran or a country that this feature is restricted , You better off using Firefox remote debugging , it misses port forwarding feature right now , but at least works like a charm.
For many people who still having this issue, if you are in your company's VPN/ Network try to connect directly to the internet and it will work.
For me it happened that our IP address were blocked by Google and any of google services were accessible.
I have a similar problem, where the inspect fallback link doesn't appear, if the host version is newer than the guest version. In my case, I'm using Vivaldi to debug another browser. However this still gives the above mentioned error:
HTTP/1.1 404 Not Found
Installing different browser versions is cumbersome and unncessary. In my current browser, break in the page chrome://inspect/#devices's inspect.js where it says:
const browserNeedsFallback =
isVersionNewerThanHost(browser.adbBrowserVersion);
Run the snippet:
isVersionNewerThanHost = () => true
And the inspect fallback link will appear again.
I uninstall chrome in my movil and work ok..the problem is the last update chrome in android
I found a solution. Don't need to downgrade you Chrome version. just remove a plugin. This plugin is for the VPN proxy.
Yes. Maybe the issue is caused by a plugin.
I had the same problem. I had to reset the phone to factory defaults.
now working. Android 6

Why my PhoneGap app is starting slowly on android device?

I've been working with PhoneGap for about two weeks now, yesterday I've build a new android app all went well except that the app starts very slow on my android device. It first shows me for three seconds just a black background except the navbar. So I want to ask how to boost it up or which files I could remove or what I've done wrong please I would be happy if you explain me also the file structure. Thanks in forward for your answers!
Your question is little bit vague. Please, give us more information about your app, about your config and what you’ve already tried.
If my app is slow on any device, I do generally the following:
Check if the same problem occurs in the browser
What’s going on at the start of the app in the browser (Chrome Dev Tools)
If nothing unusual happens, check the logs on the device
For Android, I’m using Logcat for checking what’s happening on the phone.
In order to use Logcat:
1.) Enable debugging mode on your Android phone
2.) You need Android Studio
3.) Connect your phone to your computer and start Logcat in Android Studio 3.1.2
4.) Check the logs while you are starting your app on the phone

Phonegap not showing up in Chrome remote debug

I'm trying to debug a Phonegapp app on my Android tablet running via the Phonegap developer app.
According to this post, and Google's own remote debugging docs, Phonegap should show up as a tab in DevTools > remote devices because Cordova is basically just a WebView (as I understand it.) The device is connected via USB and is successfully detected. Alas, this is all I see when my app is running on the device:
If I open Chrome on the tablet, and go to a page, it does show up, so it seems it's only the app it won't show. What am I doing wrong?
[Update:
I also found this post, which makes the process sound decidedly more complicated. However, it's 3 years old and talks about modifying a file (AndroidManifest.xml) that I don't have in my PG build, so I assume it's outdated.]

Ionic cannot get live reload option on attached android device to work

Just started working with Ionic the other day, installed most recent version of framework and all required dependencies on my 2015 Macbook Air running El Capitan.
Everything seems to be working OK with the exception of this issue:
When trying to use the live reload option for development with my usb-connected android phone (via command "ionic run android -l"), I receive the following error message on my phone:
Webpage not available
The webpage at http://[local IP and port of my computer] could not be loaded because:
net::ERR_ADDRESS_UNREACHABLE
Note: I don't receive this message when I leave out the -l option.
I know that others have had this issue and I have read virtually all related articles that come up in a google search, but I am still at a loss for a solution.
Some have said this has to do with default restrictions imposed with Cordova whitelist plugin. I tried the changes specified in the below article but to no avail.
https://github.com/apache/cordova-plugin-whitelist
I've tried all other fixes that come up from a google search but without success. As a developer (even a relatively new one) I expect this as par for the course, but the frustration is starting to sink in.
Any help is much appreciated. Thanks.
I think you should see this link: http://blog.ionic.io/handling-cors-issues-in-ionic/

MyEclipse Mobile Web Simulator Unsupported Browser?

I am building out a Cordova mobile app in MyEclipse and using the Mobile Web Simulator. Suddenly, I began receiving an "Unsupported Browser" warning in the simulator window, indicating that "only Chrome and Chromium based browsers are supported." But it was working fine, and obviously I have Chrome installed. I tried restarting MyEclipse but that didn't help. Anyone seen this happen?
Check the location of your mobile simulator browser. From the Window menu, select Preferences and then the MyEclipse/Mobile Tools/Mobile Web Simulator page. You can select the location of your Chrome browser there. I'm not sure if there is a minimum release of Chrome that is required but it's probably best to ensure that you have the latest release.
myeclipse2014 can not run myEclipse web Simulator application solution:
Manually delete the MyEclipse Sim Chrome profile directory.On Windows the chrome profile can be found at path similar to <userhome>\AppData\Local\Temp\myeclipse_mobilewebsimulator_userdata\
Close the simulator before deleting this directory.
Delete the directory above
Launch the simulator
I found a quick and simple solution to the "unsupported browser" issue. Go to the Window menu(in Myeclipse),then "Preferences", click "Reset simulator settings",hit apply and to my surprise...the Mobile Web Simulator was back. Why it suddenly didnt work I have no idea. I tried to uninstall and reinstall Chrome to no avail either. Hope it works for you.Good luck!

Categories

Resources