[TUTO] Dead screen, rooted phone, how to remote control

Search This thread

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
Hello!

First of all, I want to say that even though I'm describing a simple process, it was quite hard to find the answer for me. :p

I'm a SGS3 International Version (i9300) user and a few days ago I was at work, using flashlight on my device.
Suddenly I did drop my phone and the screen got cracked and the LCD too, making my device locked and from that point I couldn't see my messages, I couldn't backup my apps with Titanium Backup and, well, I needed to speak with a lot of people on Whatsapp. So, I decided to look for a answer at the internet.
I had a pattern lock screen, and I tried to remove the lockscreen with the steps to write on settings.db with sqlite but, no go.

I tried everything. I was using Temasek build with CM11 as base.
It was difficult to go into the phone. I had use the Android Screencast ( from code.google.com/p/androidscreencast ) but, I was only able to see what was on the screen, but with no interaction.

So, here is the best way to get into the phone, when you are ROOTED (IMPORTANT) and USB Debugging enabled:
(NOTE THAT ALL YOUR PHONE DRIVERS [adb drivers] SHOULD BE ALREADY INSTALLED)


Go to Google Play and download from there the app:

droidVNC Server


If you don't have any data enabled, then go to: APK DOWNLOADER
Paste the URL
Code:
https://play.google.com/store/apps/details?id=org.onaips.vnc

And download the app.

Open a prompt command, go to your adb folder, type:
Code:
adb install "type your downloaded apk path"

Go to your notepad app, and create a script with the follow commands:

Code:
adb shell am start -n  org.onaips.vnc/.MainActivity
adb forward tcp:5901 tcp:5901
adb forward tcp:5801 tcp:5801
adb shell am force-stop org.onaips.vnc
adb shell /data/data/org.onaips.vnc/files/androidvncserver

Save inside your adb folder with a name like: VNC.bat
Note that I'm running Windows.
If you have another OS, then, run line by line or make your own script.

Now, you can click and run VNC.bat
It will appear a screen saying:
Code:
Waiting for a connection


NOW, it's almost done!!!
Indeed, you just have VNC working on your phone and, with the script you just made some ports to forward to your localhost.
So, you wont need any router or to be connected to a router.
Will be faster than Wireless connection.

So, download any VNC viewer you prefer:
I did use the Real VNC Viewer: Download Here

You will see a screen like this:

attachment.php


Type exactly what you see above:

Code:
localhost:5901

And you are good to go!!!

Now you can swype your pattern lock screen and see whatever you would see with your smartphone screen!

See ya!
 

Attachments

  • Real.jpg
    Real.jpg
    25.8 KB · Views: 1,302
Last edited:
  • Like
Reactions: a.fontenele

wallerius

Member
Dec 20, 2008
7
0
Hello

Wow - if I could get this to work I would be very glad!

Followed your instructions but get the "error: Device not found, -Waiting for device-" message when I try to install the downloaded APK

I have a SG2 and screen is totaly dead, but when I turn it on I ca nhear the sound playing and the meny buttons have lights. So I now it's working

I appreciate any help you can give me.

Thanks
/Walter
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
Hello

Wow - if I could get this to work I would be very glad!

Followed your instructions but get the "error: Device not found, -Waiting for device-" message when I try to install the downloaded APK

I have a SG2 and screen is totaly dead, but when I turn it on I ca nhear the sound playing and the meny buttons have lights. So I now it's working

I appreciate any help you can give me.

Thanks
/Walter

Have your device been rooted?
And... with USB Debugging enabled?

If it has... so, you just need to wait for your device to became fully loaded (after boot) and plug your USB cable.
Than, if your USB Debugging is enable for real, open Command Prompt and go to your ADB folder.
Type
Code:
adb devices

It should appear one device at least, something like the image attached:
attachment.php



If does not appear, then USB Debugging is probably off under your developer settings.

Hope I could help!
 

Attachments

  • adb-devices.png
    adb-devices.png
    27.5 KB · Views: 603
Last edited:

wallerius

Member
Dec 20, 2008
7
0
Have your device been rooted?
And... with USB Debugging enabled?

If it has... so, you just need to wait for your device to became fully loaded (after boot) and plug your USB cable.
Than, if your USB Debugging is enable for real, open Command Prompt and go to your ADB folder.
Type
Code:
adb devices

It should appear one device at least, something like the image attached:
attachment.php



If does not appear, then USB Debugging is probably off under your developer settings.

Hope I could help!

Thanks again

I am almost 100% sure it is on, but I get nothing. I think it might be the drivers that causing this.

tried it with my rooted N7 2nd gen and it worked. When I plugged it in, the PdaNET plinged and said something like "device ready". I dont get that when I plug in the SG2.

If USB not enabled - is it totaly lost then?

/W
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
Thanks again

I am almost 100% sure it is on, but I get nothing. I think it might be the drivers that causing this.

tried it with my rooted N7 2nd gen and it worked. When I plugged it in, the PdaNET plinged and said something like "device ready". I dont get that when I plug in the SG2.

If USB not enabled - is it totaly lost then?

/W

Well, sure you need to have your drivers installed...
But, if you are rooted... then "supposedly" you already have the drivers installed.

I had one problem though that could be your case:
I had to wait about 2 minutes from turning it on until it shows up. And sometimes I needed to pull out the USB cable and replug it again.
Check your Device Manager (on Windows) if it shows up).

You can try that. If none of this works, than either the USB Debugging option is disabled or your cable is not functional.
Unfortunately, if it is the case, I really don't know what answer to you.
 

wallerius

Member
Dec 20, 2008
7
0
Well, sure you need to have your drivers installed...
But, if you are rooted... then "supposedly" you already have the drivers installed.

I had one problem though that could be your case:
I had to wait about 2 minutes from turning it on until it shows up. And sometimes I needed to pull out the USB cable and replug it again.
Check your Device Manager (on Windows) if it shows up).

You can try that. If none of this works, than either the USB Debugging option is disabled or your cable is not functional.
Unfortunately, if it is the case, I really don't know what answer to you.

Thanks again for your answer

When I find some more time I will have it another go. Otherwise I think I will but an used SG2 and replace the screen. Since the phone have some years now, the used ones are pretty cheap (much cheaper than buying a new screen that is)

I would even settle with a cracked screen - as long as I ca naccess it and copy my data/SMS/MMS etc etc

Thanks again
/W

---------- Post added at 10:16 AM ---------- Previous post was at 09:22 AM ----------

Yay!

it worked, well...I got passed the "adb device" thing. I pluged out the battery, and reconected the USB and then it poped up.

But when I try to install I get this error

"/sbin/sh: pm: not found"
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
Thanks again for your answer

When I find some more time I will have it another go. Otherwise I think I will but an used SG2 and replace the screen. Since the phone have some years now, the used ones are pretty cheap (much cheaper than buying a new screen that is)

I would even settle with a cracked screen - as long as I ca naccess it and copy my data/SMS/MMS etc etc

Thanks again
/W

---------- Post added at 10:16 AM ---------- Previous post was at 09:22 AM ----------

Yay!

it worked, well...I got passed the "adb device" thing. I pluged out the battery, and reconected the USB and then it poped up.

But when I try to install I get this error

"/sbin/sh: pm: not found"

Take a look at this thread HERE
It might have the answer
 
Last edited:

wallerius

Member
Dec 20, 2008
7
0
Take a look at this thread HERE
It might have the answer

Yepp, I had managed to start the phone in some sort of "recovery mode". But the funny thing is this;

When I did so my PC managed to locate the phone correctly and I could identify it with the "adb devices" command.

But when I restarded the phone (hearing the Samsung tone - knowing it started correctly) I cant use the adc command (and no ping/notification from PdaNet)

Very odd
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
Yepp, I had managed to start the phone in some sort of "recovery mode". But the funny thing is this;

When I did so my PC managed to locate the phone correctly and I could identify it with the "adb devices" command.

But when I restarded the phone (hearing the Samsung tone - knowing it started correctly) I cant use the adc command (and no ping/notification from PdaNet)

Very odd

So, it did not worked? Probably USB Debugging is not enabled.
 

loonieryan

Senior Member
Nov 29, 2010
340
76
My LCD is dead, managed to get the VNC server installed via Google Play on my desktop but this file does not exist on my device:
/data/data/org.onaips.vnc/files/androidvncserver

How do I start the VNC Server on my phone via ADB?
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
My LCD is dead, managed to get the VNC server installed via Google Play on my desktop but this file does not exist on my device:
/data/data/org.onaips.vnc/files/androidvncserver

How do I start the VNC Server on my phone via ADB?

I've said this on the instructions.

Go to: APK DOWNLOADER
Paste the URL

Code:
https://play.google.com/store/apps/details?id=org.onaips.vnc
And download the app.

Open a prompt command, go to your adb folder, type:

Code:
adb install "type your downloaded apk path"
Go to your notepad app, and create a script with the follow commands:


Code:
adb devices
adb forward tcp:5901 tcp:5901
adb forward tcp:5801 tcp:5801
adb shell /data/data/org.onaips.vnc/files/androidvncserver

Save inside your adb folder with a name like: VNC.bat
Note that I'm running Windows.
If you have another OS, then, run line by line or make your own script.

Now, you can click and run VNC.bat
It will appear a screen saying:

Code:
Waiting for a connection
 

loonieryan

Senior Member
Nov 29, 2010
340
76
I guess you didn't understand what I said the first time: it's already installed. The folder /data/data/org.onaips.vnc exists, but there's no files subfolder in there and no androidvncserver file anywhere on my device.

I'm on CM11...
 

loonieryan

Senior Member
Nov 29, 2010
340
76
try to do:
Code:
adb shell
cd /data/data/
ls

and see if there is any folder with org.onaips.vnc

It's already installed through Google Play (remotely). When I run adb install it gives me an error that it is already installed:
Code:
3131 KB/s (2084419 bytes in 0.650s)
        pkg: /data/local/tmp/org.onaips.vnc.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]

However, in /data/data/org.onaips.vnc all I see is this lib symbolic link and nothing else:
Code:
root@d2att:/data/data/org.onaips.vnc # ls -al
ls -al
lrwxrwxrwx install  install           1970-01-01 19:00 lib -> /data/app-lib/org.onaips.vnc-1

I also ran a find command to search for androidvncserver at the root level of my phone and did not find anything matching that name.

Any other ideas on how to run this on my phone through ADB? Otherwise I'm SOL...
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
It's already installed through Google Play (remotely). When I run adb install it gives me an error that it is already installed:
Code:
3131 KB/s (2084419 bytes in 0.650s)
        pkg: /data/local/tmp/org.onaips.vnc.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]

However, in /data/data/org.onaips.vnc all I see is this lib symbolic link and nothing else:
Code:
root@d2att:/data/data/org.onaips.vnc # ls -al
ls -al
lrwxrwxrwx install  install           1970-01-01 19:00 lib -> /data/app-lib/org.onaips.vnc-1

I also ran a find command to search for androidvncserver at the root level of my phone and did not find anything matching that name.

Any other ideas on how to run this on my phone through ADB? Otherwise I'm SOL...

Ok... i've tested this with my LG G2 and, for my surprise, you are right...
But, the folder org.onaips.vnc/files/ wasn't there.
So, I opened the app and after opening, it seems that the app creates everything.

So, after a successful opening, you will see the files folder and the androidvncserver file.

I guess you can try to start the app with:
Code:
adb shell am start -n  org.onaips.vnc/.MainActivity

After using this, then run all the instructions again from the main thread

Lucky!
 
  • Like
Reactions: loonieryan

loonieryan

Senior Member
Nov 29, 2010
340
76
Ok... i've tested this with my LG G2 and, for my surprise, you are right...
But, the folder org.onaips.vnc/files/ wasn't there.
So, I opened the app and after opening, it seems that the app creates everything.

So, after a successful opening, you will see the files folder and the androidvncserver file.

I guess you can try to start the app with:
Code:
adb shell am start -n  org.onaips.vnc/.MainActivity

After using this, then run all the instructions again from the main thread

Lucky!

Thanks! I got the server running, but now when I connect with any VNC client all I see is a black screen. I bet it is because my screen is locked. Do you see your lock screen with VNC and are you able to enter a lock screen pattern? I can press the home button to "wake" my phone up but the VNC viewer still only shows a black screen.
 

ploquets

Senior Member
Dec 9, 2011
71
19
Uruguaiana, RS
Thanks! I got the server running, but now when I connect with any VNC client all I see is a black screen. I bet it is because my screen is locked. Do you see your lock screen with VNC and are you able to enter a lock screen pattern? I can press the home button to "wake" my phone up but the VNC viewer still only shows a black screen.

Are you trying to use VNC connected to a wifi router or via USB?
I got this problem trying to use with and IP instead of localhost...

Try with USB exactly like I said on the main thread... It should work! That's why we forward those ports.
And, check if there is any application on your PC trying to use same ports 5901 and 5801

With me, I could see lock screen and could input my pattern to unlock... only thing that didn't work was PC keyboard, I had to insert manually any letter I would want with mouse, using "on screen keyboard"... like we are used to do with our fingers.

Hope it works for you !

Waiting your reply


Enviado do meu LG-G2
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hello!

    First of all, I want to say that even though I'm describing a simple process, it was quite hard to find the answer for me. :p

    I'm a SGS3 International Version (i9300) user and a few days ago I was at work, using flashlight on my device.
    Suddenly I did drop my phone and the screen got cracked and the LCD too, making my device locked and from that point I couldn't see my messages, I couldn't backup my apps with Titanium Backup and, well, I needed to speak with a lot of people on Whatsapp. So, I decided to look for a answer at the internet.
    I had a pattern lock screen, and I tried to remove the lockscreen with the steps to write on settings.db with sqlite but, no go.

    I tried everything. I was using Temasek build with CM11 as base.
    It was difficult to go into the phone. I had use the Android Screencast ( from code.google.com/p/androidscreencast ) but, I was only able to see what was on the screen, but with no interaction.

    So, here is the best way to get into the phone, when you are ROOTED (IMPORTANT) and USB Debugging enabled:
    (NOTE THAT ALL YOUR PHONE DRIVERS [adb drivers] SHOULD BE ALREADY INSTALLED)


    Go to Google Play and download from there the app:

    droidVNC Server


    If you don't have any data enabled, then go to: APK DOWNLOADER
    Paste the URL
    Code:
    https://play.google.com/store/apps/details?id=org.onaips.vnc

    And download the app.

    Open a prompt command, go to your adb folder, type:
    Code:
    adb install "type your downloaded apk path"

    Go to your notepad app, and create a script with the follow commands:

    Code:
    adb shell am start -n  org.onaips.vnc/.MainActivity
    adb forward tcp:5901 tcp:5901
    adb forward tcp:5801 tcp:5801
    adb shell am force-stop org.onaips.vnc
    adb shell /data/data/org.onaips.vnc/files/androidvncserver

    Save inside your adb folder with a name like: VNC.bat
    Note that I'm running Windows.
    If you have another OS, then, run line by line or make your own script.

    Now, you can click and run VNC.bat
    It will appear a screen saying:
    Code:
    Waiting for a connection


    NOW, it's almost done!!!
    Indeed, you just have VNC working on your phone and, with the script you just made some ports to forward to your localhost.
    So, you wont need any router or to be connected to a router.
    Will be faster than Wireless connection.

    So, download any VNC viewer you prefer:
    I did use the Real VNC Viewer: Download Here

    You will see a screen like this:

    attachment.php


    Type exactly what you see above:

    Code:
    localhost:5901

    And you are good to go!!!

    Now you can swype your pattern lock screen and see whatever you would see with your smartphone screen!

    See ya!
    1
    It's already installed through Google Play (remotely). When I run adb install it gives me an error that it is already installed:
    Code:
    3131 KB/s (2084419 bytes in 0.650s)
            pkg: /data/local/tmp/org.onaips.vnc.apk
    Failure [INSTALL_FAILED_ALREADY_EXISTS]

    However, in /data/data/org.onaips.vnc all I see is this lib symbolic link and nothing else:
    Code:
    root@d2att:/data/data/org.onaips.vnc # ls -al
    ls -al
    lrwxrwxrwx install  install           1970-01-01 19:00 lib -> /data/app-lib/org.onaips.vnc-1

    I also ran a find command to search for androidvncserver at the root level of my phone and did not find anything matching that name.

    Any other ideas on how to run this on my phone through ADB? Otherwise I'm SOL...

    Ok... i've tested this with my LG G2 and, for my surprise, you are right...
    But, the folder org.onaips.vnc/files/ wasn't there.
    So, I opened the app and after opening, it seems that the app creates everything.

    So, after a successful opening, you will see the files folder and the androidvncserver file.

    I guess you can try to start the app with:
    Code:
    adb shell am start -n  org.onaips.vnc/.MainActivity

    After using this, then run all the instructions again from the main thread

    Lucky!