Debugging Android application by signing
I want to run or debug my signed application with intellij.
With intellij 132.784 "Allow to run/debug android application from atrifact" feature added. http://youtrack.jetbrains.com/issue/IDEA-88460
So I tried it.
I created a keystore and keys for my Android application.
I can Generate Signed Application. Then I copy this file to my SD card and deploy application from card.
But I need to deploy from intellij.
- I created an artifact. Type: Android application and selected my application as module.
- From the Android tab of the Artifact dialog, I selected "Release signed" and selected my certificate.
Then I edited my configuration.
From configuration's Package tab I selected "Deploy custom artifact" and selected my artifact.
Then I "run" my application. It deploys signed application and application works well.
But with using this onfiguration, when I press "debug", intellij builds succesfully, I see "Waiting for debugger" in my phone's screen.
But nothing happens. I uninstall application from phone.
Press "debug" and I again see "Waiting for debugger" dialog in my phone. But application doesn't start.
When I close this dialog with "force close", dialog closes.
Then in installed applications part, I see my application and I can run from there.
I can create another configuration and select "deploy default apk".
But because of the phone has the same name package (which is signed already)
I get an error that certificates are different.
So every time I try signed and unsigned application I need to uninstall another one.
I want to use signed application only.
Please sign in to leave a comment.
To summarize my problem:
- I created a custom key.
- I want to run or debug my application with this custom key.
If I use unsigned application, everytime I use signed application I need to uninstall my app from phone and lose my cached data.
I use, IntelliJ 132-839.
Isn't this a limitation of the Android platform, that you can't replace an unsigned application with a signed one if they have the same package name? I'm doing the same thing for my application when I switch from unsigned to signed.