Addev
Addev

Reputation: 32221

Different apk signatures in Android

I have a little problem. I program in two different computers and when I change from one to the other and I try to run an aplication the adb return an error because the instaled apk and the new one have different signatures and I have to manually uninstall it.

Is there some way of avoiding that?

Thanks

Upvotes: 3

Views: 1098

Answers (4)

ImR
ImR

Reputation: 887

You can use the same debug certificate across multiple machines, you just need to copy it from one to the others. I do this on my 4 development machines and it saves a lot of frustration, especially when you don't want to delete your app's datastores.

In windows, the keystore is located in C:\Users\[username]\.android by default. I'm sure there are analogs for other operating systems.

Dropbox is really helpful for syncing keystores.


You can alternatively use a custom keystore, as long as it has the same keystore and alias names and passwords. More documentation here.

Upvotes: 1

Zulaxia
Zulaxia

Reputation: 2732

Another variation on Phil's answer is that there is an option within the Android settings in Eclipse to use an alternative debug key, so you needn't actually overwrite with the copy.

I share such things between my desktop and my laptop with Dropbox and point the alternate debug key setting to one in there.

Upvotes: 2

goto10
goto10

Reputation: 4370

Edit: See Phil's comment about copying over debug.keystore. That seems like a preferable solution.

When you build an Android app it's signed with a debug key specific to that machine. In order to build from two machines without having to delete the app each time you switch you'd need to sign the apk every time you build with the same key.

Personally, I just delete the app whenever I switch environments but I could see that being a pain if you switch back and forth a lot.

Upvotes: 1

Phil Lello
Phil Lello

Reputation: 8639

I believe you can just copy the debug.keystore file from one machine to another (I'm sure I've done this, but I'm currently developing on 1 machine).

Upvotes: 3

Related Questions