simple script to launch nandroid backups with android emulator saving comments into a file, so you can easily index your backups
- create your AVD
- copy your backups to some dir (adb pull /sdcard/nandroid ~/Desktop/nandroid)
- fix paths in the script to match your configuration
that should do the trick.
this script lacks testing, don’t blame me if something doesn’t work.. just fix it or write your own.
#!/bin/bash
# author: mixer_
# copyright 2009
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
nandroid_dir=~/Desktop/nandroid
android_sdk=/opt/android-sdk-1.6
avd_name=nandroid
sdcard_img=sdcard.img
memory=500
cpu_delay=0
cmnt_file=nandroid.txt
avd_dir=$android_sdk/platforms/$avd_name
echo "backup of system and data images.."
mv $avd_dir/images/system.img $avd_dir/images/system.img.bak
mv $avd_dir/images/userdata.img $avd_dir/images/userdata.img.bak
if [ -e $cmnt_file ]; then
echo "backup of old comment file.."
mv $cmnt_file $cmnt_file.old
fi
for nand in $(find $nandroid_dir/* -type d -maxdepth 0 &2>/dev/null); do
echo `basename $nand` ..
cp $nand/system.img $avd_dir/images/;
cp $nand/data.img $avd_dir/images/userdata.img;
echo "insert a comment and press CTRL-D after closing the emulator to try the next one.."
echo "-----------------------"
# this is blocking .. your comments will be pushed after you close the emulator to keep things clean and simple
$android_sdk/tools/emulator -avd $avd_name -sdcard $sdcard_img -memory $memory -cpu-delay $cpu_delay -netfast
echo "[" `basename $nand` "]" >> $cmnt_file
cat | while read comment; do
echo $comment >> $cmnt_file
done
echo >> $cmnt_file
echo "-----------------------"
done
echo "restoring system and data backup.."
mv $avd_dir/images/system.img.bak $avd_dir/images/system.img
mv $avd_dir/images/userdata.img.bak $avd_dir/images/userdata.img