5,595,067 Members 40,683 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Broke Screen, Want to Backup files

Tip us?
 
loolnicetry
Old
#1  
Junior Member - OP
Thanks Meter 1
Posts: 24
Join Date: Nov 2013
Default [Q] Broke Screen, Want to Backup files

Hi,

So today the front of my Nexus 4 cracked and rendered it completely dysfunctional. The worst part is that there's a screen lock, making it impossible for me to access through Android File Transfer. I was reading that you could use adb and screencast to access the phone and to unlock it, allowing for me to retrieve files. But after installing and running commands, it seemed like I couldn't find a device when I inputted the command 'adb devices'. I know, I searched it up and I think the reason is that usb debugging was not enabled (I don't remember if I did or didn't enable it at all). I've read past threads which explain how to enable it even with a cracked screen but I'm just too confused on how to do it. All this SDK and AVD stuff confuses the heck out of me (I'm fairly new to the whole Android notion) so I practically have the IQ of a 5 year old. My phone is rooted (In which it did wipe the memory so that may be why debugging could be off) and I'm currently flashing Cyanogenmod. Could someone please explain to me how do I enable debugging with a dysfunctional screen like I'm 5? Also, if there were an easier alternative to retrieving/backing up my files that would be nice knowing too because all of this stuff is currently doing my head in.

Thanks!
 
xjcook
Old
#2  
xjcook's Avatar
Senior Member
Thanks Meter 534
Posts: 239
Join Date: Apr 2012
You can try to access adb from recovery too.
Turn off phone and start by holding VOL-DOWN and POWER together. You will boot into BOOTLOADER mode and there switch to RECOVERY MODE by VOLUME button (2 times press is this mode). If you have installed CyanogenMOD, then you have probably advanced recovery (CWM or TWRP). Now try command "adb devices".
If you haven't CWM or TWRP recovery installed, boot again into BOOTLOADER mode and flash recovery by fastboot.
 
loolnicetry
Old
(Last edited by loolnicetry; 21st November 2013 at 08:30 PM.)
#3  
Junior Member - OP
Thanks Meter 1
Posts: 24
Join Date: Nov 2013
Quote:
Originally Posted by xjcook View Post
You can try to access adb from recovery too.
Turn off phone and start by holding VOL-DOWN and POWER together. You will boot into BOOTLOADER mode and there switch to RECOVERY MODE by VOLUME button (2 times press is this mode). If you have installed CyanogenMOD, then you have probably advanced recovery (CWM or TWRP). Now try command "adb devices".
If you haven't CWM or TWRP recovery installed, boot again into BOOTLOADER mode and flash recovery by fastboot.
Thanks for the quick reply,

After I hit advanced recovery and selecting my backup, which option do I press? Do I restore the boot, system, data, cache, or sd-ext?
Also typing in adb devices only lists the recovery device and I don't seem to be able to access it through Android File Transfer, what do I do with the serial number it tells me?

By the way I don't have any backups when I had no screen pattern so wouldn't recovering those areas still give get me locked out?
 
xjcook
Old
#4  
xjcook's Avatar
Senior Member
Thanks Meter 534
Posts: 239
Join Date: Apr 2012
Quote:
Originally Posted by loolnicetry View Post
Thanks for the quick reply,

After I hit advanced recovery and selecting my backup, which option do I press? Do I restore the boot, system, data, cache, or sd-ext?
Also typing in adb devices only lists the recovery device and I don't seem to be able to access it through Android File Transfer, what do I do with the serial number it tells me?

By the way I don't have any backups when I had no screen pattern so wouldn't recovering those areas still give get me locked out?
Android File Transfer is not working in recovery mode, but you can pull required files by "adb pull /sdcard/some-file-or-folder/ /to/some/path/on/your-system/". Of course you can pull whole /sdcard/. You can try also adb backup (I didn't try it yet). From recovery you can also make nandroid backup of the system and transfer to computer by adb pull.

In recovery mode you have access to full system (maybe you must mount some partitions), that means you can use magic command "adb shell", to get shell (in shell you can use "ls" for list files, "cd" for change directory) and do what you want. To remove screen lock try some guide from XDA, I've found for example [GUIDE][HOW-TO]Crack android pattern lock! or [EASIEST]Crack Android Pattern/Pin/Password Lockscreen without root.

I hope this will help you.
 
loolnicetry
Old
#5  
Junior Member - OP
Thanks Meter 1
Posts: 24
Join Date: Nov 2013
Quote:
Originally Posted by xjcook View Post
Android File Transfer is not working in recovery mode, but you can pull required files by "adb pull /sdcard/some-file-or-folder/ /to/some/path/on/your-system/". Of course you can pull whole /sdcard/. You can try also adb backup (I didn't try it yet). From recovery you can also make nandroid backup of the system and transfer to computer by adb pull.

In recovery mode you have access to full system (maybe you must mount some partitions), that means you can use magic command "adb shell", to get shell (in shell you can use "ls" for list files, "cd" for change directory) and do what you want. To remove screen lock try some guide from XDA, I've found for example [GUIDE][HOW-TO]Crack android pattern lock! or [EASIEST]Crack Android Pattern/Pin/Password Lockscreen without root.

I hope this will help you.
I CANNOT THANK YOU ENOUGH! You were easy to understand and got straight to the point which was perfect! On a side note, do you know if there's a way I can extract and save my sms messages and read them on my computer? I know I can take out the .db file but it's complicated to open on a Mac and it's quite an effort. (Considering my phone still has a lock on it)
 
xjcook
Old
#6  
xjcook's Avatar
Senior Member
Thanks Meter 534
Posts: 239
Join Date: Apr 2012
Quote:
Originally Posted by loolnicetry View Post
I CANNOT THANK YOU ENOUGH! You were easy to understand and got straight to the point which was perfect! On a side note, do you know if there's a way I can extract and save my sms messages and read them on my computer? I know I can take out the .db file but it's complicated to open on a Mac and it's quite an effort. (Considering my phone still has a lock on it)
I'm really happy that I helped you!
Android is storing messages, contacts in SQLite database, there is not another way to grab these files from recovery. But it's not complicated to extract these files. Download for Mac OS X sqlite-shell-osx-x86-XXX.zip from SQLite Download Page and extract it somewhere.

Then pull messages by
Code:
cd /path/where/is/extracted-sqlite
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db .
Finally you can list your messages by
Code:
./sqlite3 mmssms.db 'select address,body from sms'
If last command is not working try make it executable and repeat previous step
Code:
chmod +x sqlite3
 
loolnicetry
Old
#7  
Junior Member - OP
Thanks Meter 1
Posts: 24
Join Date: Nov 2013
Quote:
Originally Posted by xjcook View Post
I'm really happy that I helped you!
Android is storing messages, contacts in SQLite database, there is not another way to grab these files from recovery. But it's not complicated to extract these files. Download for Mac OS X sqlite-shell-osx-x86-XXX.zip from and extract it somewhere.

Then pull messages by
Code:
cd /path/where/is/extracted-sqlite
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db .
Finally you can list your messages by
Code:
./sqlite3 mmssms.db 'select address,body from sms'
If last command is not working try make it executable and repeat previous step
Code:
chmod +x sqlite3
For the pulling of the .db file, it says the remote object does not exist, what should I do?
 
xjcook
Old
#8  
xjcook's Avatar
Senior Member
Thanks Meter 534
Posts: 239
Join Date: Apr 2012
Quote:
Originally Posted by loolnicetry View Post
For the pulling of the .db file, it says the remote object does not exist, what should I do?
Hmm that is strange, maybe this will help you (especially check first answer): http://stackoverflow.com/questions/1...ntents-via-adb

Sent from my Nexus 4 using Tapatalk
 
loolnicetry
Old
#9  
Junior Member - OP
Thanks Meter 1
Posts: 24
Join Date: Nov 2013
Quote:
Originally Posted by xjcook View Post
Hmm that is strange, maybe this will help you (especially check first answer):

Sent from my Nexus 4 using Tapatalk
When I try to enter the $mkdir command it says it's not found. Am I meant to include the $ in the command?
 
loolnicetry
Old
#10  
Junior Member - OP
Thanks Meter 1
Posts: 24
Join Date: Nov 2013
Quote:
Originally Posted by xjcook View Post
Hmm that is strange, maybe this will help you (especially check first answer): http://stackoverflow.com/questions/1...ntents-via-adb

Sent from my Nexus 4 using Tapatalk
I FIXED IT MYSELF! I'm feeling a bit smart haha, it turns out my system and data wasn't mounted and all I had to do was mount it through cwm. Thanks a lot friend you were a great help, I'd be panicking a substantial amount without you!

The Following User Says Thank You to loolnicetry For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes