Created
March 11, 2010 21:25
-
-
Save 0xced/329671 to your computer and use it in GitHub Desktop.
Use your own Address Book in the iPhone Simulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ~/Library/Application\ Support/MobileSync/Backup | |
backup=`ls -t1 | sed -n '1p'` # most recent backup | |
for f in "$backup"/*.mdinfo; do | |
grep -q "Library/AddressBook/AddressBook.sqlitedb" $f | |
if [ $? -eq 0 ]; then | |
addressbook=`basename $f .mdinfo` | |
cp -v "`pwd`/$backup/$addressbook.mddata" ~/Library/Application\ Support/iPhone\ Simulator/User/Library/AddressBook/AddressBook.sqlitedb | |
exit $? | |
fi | |
done | |
echo "Address Book not found in iPhone backup" >&2 | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment