In order to retrieve my Android app's database from device, I execute this commands:
prompt1> adb shell
prompt2> run-as my.app.package
prompt3> chmod -R 777 databases
prompt3> exit
prompt2> cat /data/data/my.app.package/databases/database.db > /sdcard/database.db
prompt2> exit
prompt1> adb pull /sdcard/database.db
I want automate this process so I have created a script with those commands. Problem is that when I execute it, adb shell is opened and the next commands are not executed.
Note that run-as my.app.package opens another third shell.
EDIT
When I execute the script:
prompt1> get_database.cmd
prompt2> _
It opens prompt2, but it stops.
How can I do it?
run-asopen a third shellsh,csh, etc.) or for Windows'CMD?