NKijak
NKijak

Reputation: 1172

How can you reproduce the procedure that occurs when a Android market app is updated?

I have an app that reads and writes files during onCreate. The problem is that when the app is installed via the Market and run the first time the files it needs to get have no access to them. I get FileNotFound exceptions even though the file is there. If I back out of the app and reopen it then the files can be read.

This is not the same behavior when pushing the apk from eclipse or adb. In fact I was able to reproduce the problem using eclipse and thought I fixed it doing adb uninstalls and eclipse installs but the problem persists for users pulling the update from the market.

Upvotes: 4

Views: 240

Answers (3)

NKijak
NKijak

Reputation: 1172

adb -d shell pm uninstall -k package.name lets you remove a package without removing the data files or cache.

Upvotes: 0

Greg Giacovelli
Greg Giacovelli

Reputation: 10184

If you increase your CodeVersion, then build your apk (signed with the same cert as the previous market application), running adb -d install -r package.name will install the application without removing the data. It basically does an update. I believe using the -l option will ensure that the CodeVersion number is also of a greater value than is currently on the phone.

Upvotes: 2

Macarse
Macarse

Reputation: 93153

I would try:

  • Increasing the android:versionCode in your AndroidManifest.xml
  • Generating the apk
  • adb install name.apk

Upvotes: 0

Related Questions