I'm developing App Engine application in Android Studio and testing it on my local machine (with local datastore). It's Java based app. Every time I re-run the server the local datastore is cleared. I've found several solutions for Python developers but it looks like there's no answer for Java.
Android Studio allows only to change:
I've tried with VM args but these are for Java VM not for the app server obviously. Is there a way to persist local datastore across server restarts? It would be perfect If I could run this configuration directly from Android Studio.
The local datastore gets cleared because it is by default located in the application exploded war directory (which is deleted in its entirety on every build).
Instead of having to running the dev server manually from a terminal, you can actually just add a VM arg to the appengine run configuration to locate the datastore in another location:
-Ddatastore.backing_store="/path/to/datastore/file/location/local_db.bin"
(Solution found on: https://code.google.com/p/android/issues/detail?id=68225)
Like Arjan says, you can use -Ddatastore.backing_store
.
If you use Android Studio 1.5, modify build.gradle
. On appengine
put the paramater jvmFlags
. Example:
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
jvmFlags = ["-Ddatastore.backing_store=\"D:/temp/local_db.bin\""]
}
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