Had exactly the same problem recently (on a friend's Nexus S running stock Android 4.0 with a completely broken screen & digitizer and adb switched off):
Get a recovery system running with adb enabled. Then use adb console to access the device's data and create a backup. On Nexus S you cannot use the sdcard to get the data off the device, so you need to use adb for that.
Prerequisites:
- Phone does have fastboot mode with boot command enabled
- Phone still works (except for the screen)
- SDK installed (with working adb + fastboot executables)
- CWM recovery image downloaded to /tmp/cwm.zip (has enabled adb when started)
- Linux with installed uudecode (part of package 'sharutils' on Ubuntu)
How to do it:
a) Start device in fastboot mode and boot the CWM recovery this way
me@workstation:~$ fastboot boot /tmp/cwm.zip
b) wait some time for CWM to boot, then log into the device
me@workstation:~$ adb shell
shell@android:/ $ mkdir -p /tmp/backup/data /tmp/backup/sdcard
Replace DATA_DEV and SDCARD_DEV by the real devicenames
depending on your phone, it's most likely one of these:
- DATA_DEV: /dev/block/mtdblock*
- SDCARD_DEV: /dev/block/mmcblk*
- use 'df' command to find candidates by size.
shell@android:/ $ mount -oro <DATA_DEV> /tmp/backup/data
shell@android:/ $ mount -oro <SDCARD_DEV> /tmp/backup/sdcard
shell@android:/ $ exit
me@workstation:~$ adb shell tar czf - /tmp/backup \| uuencode foo | uudecode -o - > /tmp/backup.tar.gz
Caveats and further explanations:
- Why 'uuencode'? ADB console seems to intercept the data stream and obviously inserts a carriage return before each single line feed. Uuencoding the data before transmitting it via adb's stdout protects against that.
- Does not work on encrypted devices
- You can also just repeat the process on unmounted devices and transmit all of the /dev/block/* one by one and figure out which one is for what afterwards
- You need to find a suitable CWM recovery image yourself