Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug Ionic application with android:debuggable="false"

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?

like image 967
user3007799 Avatar asked Apr 26 '17 20:04

user3007799


People also ask

How do I debug an ionic app on Android?

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.

How can you test debug an ionic app?

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.

What is Android Debuggable true?

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.


2 Answers

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.

like image 130
Sébastien Avatar answered Nov 10 '22 00:11

Sébastien


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.

like image 20
Diego Martinez Avatar answered Nov 09 '22 22:11

Diego Martinez