A have installed my Ionic application on real device. The app is released, signed and has android:debuggable="false". I faced some problems on that specific device and I need to debug it (not to create and install new --debug build).
Is there some way to debug it? To "attach" it somehow to a keystore to be authorised, or something else...? Any ideas?
Developer Options & USB Debugging are enabled by default in the Android emulator. Open the Chrome browser and navigate to the URL chrome://inspect/#devices . Your connected Android device should show up in the list of Remote Targets. On your device, open the Ionic app that you would like to debug using Chrome.
You can use remote debugging with an actual device or simulator. If you use a real device, ensure that debugging is enabled both from the device and on the remote browser. In Android, you need to go to the settings and enable developer mode first and then USB Debugging under the developer options menu.
By putting android:debuggable="true" in your manifest file, application will go in debug mode, that means android will manage all logs file regarding your application. But make sure put it again false (or remove this tag) if application will going to live or for release mode.
I am still trying to find a better way, but so far I am able to debug my Ionic app (a signed --release
build) running on a real device via the Chrome (desktop) console, by specifying:
<application android:debuggable="true">
directly in the AndroidManifest.xml
file. The attribute in not overwritten when I build the project with the Ionic CLI.
What I would prefer is to set the attribute from the config.xml
file, so I don't have to add it again manually in AndroidManifest.xml
when I remove/add the platform.
You can add this in your config.xml to solve it.
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:debuggable="true" />
</edit-config>
Then, you can debug in Chrome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With