why my phonegap app cannot be inspected by chrome inspector? - android

I'm building cordova apps using the phonegap build tool, but i can't debug it.
If I go to chrome inspect, I cannot see my application, even though I enabled the debug mode on my android phone and i already opened my app.

Related

How to stop remote debugging of Cordova App

I have a release version cordova application and trying to stop a chrome remote debugging. I have set setWebContentsDebuggingEnabled(false) on webview but still it cant stop remote debugging on chrome:inspect. It is very strange that I have an app build in release version but chrome inspects still showing this application. Is there any way to block this feature and available only on demand?

How to build Phonegap application in release mode using the online Phonegap build service

Using the online building service for Phonegap applications Adobe Phonegap Build Platform, I am looking for a way to build the app in release mode. The "enable debugging" feature is disabled but still I keep getting debuggable ".apk" files that are being rejected by Google Play Store upon submission. The config.xml of my Phonegap project does not contain any entries in that matter. Any suggestions? I am clearly looking for way to compile online as I do not want to fiddle around with the Phonegap CLI - just saying to avoid any suggestions like "use CLI-command XYZ"...

Inspect and debug a production Cordova app installed on the device from the app store

I'm trying to debug a Cordova app by inspecting it remotely using the browser.
Per example, on my iPhone, I could access the webView by Safari Developer Menu, or in my Android, using Google Chrome chrome://inspect.
It works good when I install the app on the device by the CLI
cordova run ios
cordova run android
but, when I download the same app from the store, where I published it, I can't inspect it anymore, in fact I can't find it to inspect it in Chrome/Android nor Safari/iOs.
Is there a way to inspect the production app?
How am I supposed to debug it otherwise (e.g. the bug happens only in production)?
Thanks.
I didn't verified it on Cordova but I discovered it is possible to debug a production android app by adding
android:debuggable="true"
to the manifest as an <application> tag attribute.
It's no longer possible to upload a debuggable apk:
You need to enable debugging for webviews in android application.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
add above code in main activity file.
more info about remote debugging :
https://developer.chrome.com/docs/devtools/remote-debugging/webviews/
Note : It is not recommended to turn on debugging on live playstore apps.

How to use Chrome debugging on a signed Cordova app?

I have been using the Chrome remote device inspector to debug my Cordova app. The debug version of my app has been working fine without errors. However, now I made a signed APK for the first time, which installs and opens up, but hangs in a loading screen when try to use the login functionality in my app.
I believe this could be caused by some error in a plugin, or perhaps Google Maps Javascript API failing to load, but I cannot find out what it is because the Chrome debugging is disabled in a signed app. Is there any way I can turn on the debugging?
It turns out you can turn on debugging by adding android:debuggable="true" in AndroidManifest in manifest and application tags.

How to debug Firefox OS app on Firefox for Android?

I've successfully connected Firefox for Android to my desktop Firefox, I'm able to debug pages, and even install applications.
The problem is that installed applications do not start. And in result I can't debug them. Even worse, that now I'm unable to delete installed app from device, there is no such button, and my app is not listed among android apps like those which are installed from Firefox Marketplace.
Does anyone know how to deal with that, or it is now working yet?
Ubuntu 14.10 x64, Firefox 31.0, Firefox for Android 31.0 beta (used stable with the same result), Android 4.4.4 (CyanogenMod 11)
Unfortunetely you cannot debug installed Firefox OS apps on Android phone via Firefox for Android. You can only debug web pages in Firefox for Android via remote debugging. https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Firefox_for_Android In case of Firefox OS app, you have better use App manager or simulator. Of course, if you have Firefox OS phone, you can do this via remote debugging between Firefox OS phone and your desktop.
Here are the generic instructions (after which I'll address your specific issues):
Install mozilla-apk-cli using NPM:
npm install -g mozilla-apk-cli
Use it to generate a "debuggable" APK for your app from either a source directory or a URL to the mini-manifest:
mozilla-apk-cli /path/to/source/dir/ arbitrary-name.apk
mozilla-apk-cli http://example.com/path/to/mini/manifest.webapp arbitrary-name.apk
(Context-click > Inspect Element on the "Free" button in Marketplace to discover the mini-manifest URL for an app in the Marketplace.)
Install the APK on your Android device:
adb install -r arbitrary-name.apk
Launch the app on the device. Look to the notification area for a notification about which port the remote debugger server is listening on. Forward that port on your desktop, f.e. if the port is 12345:
adb forward tcp:12345 tcp:12345
Go to Web Developer > Connect… in Firefox on your desktop and connect to localhost at the forwarded port. Commence debugging!
Notes:
Use Nightly builds of Fennec for the best experience.
Bug 929382 tracks WebIDE (née App Manager) integration.
File bugs on problems you encounter!
Now, regarding your specific issues: It sounds like you've made it past app installation but are stuck on launching and running the app. How are you launching the app? For example, are you tapping the app's icon on Android's All Apps screen? And what do you mean when you say that apps "do not start"? Do you mean that nothing happens when you launch the app, or does something happen (f.e. a splash screen appears, perhaps followed by a white screen), but the app itself doesn't appear?
It would also be useful to know the manifest URL of the app you're testing, if it's a public hosted app; or get access to the source code, if it's a public packaged app!
Finally, note this related (identical?) question: How to install packaged app on Firefox for mobile?. I copied the generic part of this answer from it, but presumably they should be consolidated into a single answer (modulo the troubleshooting info, which is specific to the problem you're encountering).

Categories

Resources