Broken screen - allow su? - Nexus 4 Q&A, Help & Troubleshooting

I'm trying to control my Nexus 4 using adb commands from computer, but when I type in adb shell and then su on command prompt I can't click "yes" on the dialog box to enable superuser permissions. How can I do this?

For anyone having the same problem, I found a solution. You'll need USB Debugging for most of this.
-Download a program called MyMobiler to your PC
-Connect your phone via usb and use MyMobiler on the pc toolbar to install the app on the phone
-You'll need to grant superuser permissions if your phone is rooted, so in order to do that you'll need to use adb commands from the Android SDK. Open up a command prompt in the platform-tools folder once you've downloaded SDK
-To get past the lock screen use commands from this link. For me (I don't have a pin or anything, I just needed to get out of the lock screen), I typed "adb shell input keyevent 22" to swipe right to the camera app and then "adb shell input keyevent 3" to hit the home button, which got me to my home screen. If you have a pin, you can type in "adb shell input text 1234" and replace 1234 with whatever your pin is
-Now you can control your screen using the commands on the link above (mainly numbers 19-23)
-If all is running correctly (and you have granted superuser permissions to let MyMobiler run on your phone), you can use the arrow keys to navigate throughout the phone
-If you have any problems, you should follow the MyMobiler start guide
I also followed this guide for help. He uses the app androidscreencast, but that didn't work for me, so I went with MyMobiler.

Related

Setting default install path in android

This post is to help you set your phones default install path to your phones sd card on any android device.
so here we go..............>>
1. First you have to enable USB debugging on your Android device from Settings > Applications > Development > USB debugging.
Now you need to download and install the Android SDK on your computer from google....please google it.
Once setup is downloaded and installed you click on Available Packages to the left.
should you get any error message at this point, enable “Force (url) in the Settings then from the list of available packages, select “Usb Driver package”, click on the Install Selected button in the bottom right corner and follow the prompts.
2. Connect your phone to your computer with a USB-cable. Your OS will prompt you to install new drivers.
Choose to install them from
C:\Program Files\Android\android-sdk\extras\google\usb_driver folder
when you are asked to install drivers
(If for some reason you are not asked to install drivers as it happens sometimes in windows 7. Go to device manager and look for your phone under the usb device list..............right click and choose update drivers....navigate to C:\Program Files\Android\android-sdk\extras\google\usb_driver folder" to update) If you do not know how to update then google it.
NOTE: You need not mount your device; you only need to plug-in the cable.
3. Next, run a command prompt and navigate to the Android-SDK/platform-tools folder. In Windows, this is done by selecting Run from the Start Menu (or by pressing Win+R) and typing cmd. You change drives in the command prompt by entering the drive letter followed by a colon ), and change folders with the CD command. For example, to enter the Android-SDK folder, simply type C: cd android-sdk.
4. Whiles in the Android-SDK/platform-tools folder, type in
adb devices
you should get a serial number starting with “H” in return. All you have to do next is enter
adb shell pm setInstallLocation 2
You’re done! Android will now install apps to the SD card by default.
To switch back to storing software on the internal memory,
enter
adb shell pm setInstallLocation 0
With everything done correctly you should not have that "annoying memory getting full" message anymore.
If you have a terminal application installed on your phone you can use also that for entering the commands and you should notice, too, that it works only with 2.x roms.
Sent from my Gingerbread on Dream using XDA App
Or you could use a utility:
http://forum.xda-developers.com/showthread.php?t=1765929
But how do you specify a specific directory?
Getting Error
I am getting error "/data/anr/traces.txt: Permission denied" when I give Command "adb shell pm setInstallLocation 2"
Please Help.....
On some updated SDK version its "set-install-location"
Hi,
I've done this and it worked. however I changed my sd card from 2Gb to 4Gb and now it will not work anymore.
I've redone the steps above and, got confirmation that [external] memory is being used, however when I want to install a new app I get the same error message "not enough space"
Android GT-S5830i
ver 2.3.6
Any suggestions
Thanks

Pershoot Kernel question

Hi guys,
could anyone explain me please how to enable usb charging with Pershoot´s Kernel (boot-cm_2636.4_ux-oc-xtra-vfpv3-d16_fp-101811)?
I rly don´t get this:
adb shell echo 1 > /sys/class/power_supply/battery/force_usb_charging
Thank you very much.
Sure bud,
The script you posted is meant to be run in a command prompt using the tablet's ADB interface. To access this you need the Android SDK (that is the tool for app development) installed on your PC. You can look up how to do this all over the interweb.
To make your life easier though, download a terminal emulator app from the Market, there are plenty of free ones. Once you've done that open it and run the script as follows
su
echo 1 > /sys/class/power_supply/battery/force_usb_charging
The "su" command gives you root access just as "adb shell" would in command prompt.
The catch is the script is not persistent after reboot. So you will need to run it again if you reboot the tab. This doesn't really bother me cause I only use it for charging in the car and it takes like 30 seconds to type in the script.
Enjoy!
Thank you very much!
Now it´s working.
FillTheVoid said:
Sure bud,
The script you posted is meant to be run in a command prompt using the tablet's ADB interface. To access this you need the Android SDK (that is the tool for app development) installed on your PC. You can look up how to do this all over the interweb.
To make your life easier though, download a terminal emulator app from the Market, there are plenty of free ones. Once you've done that open it and run the script as follows
su
echo 1 > /sys/class/power_supply/battery/force_usb_charging
The "su" command gives you root access just as "adb shell" would in command prompt.
The catch is the script is not persistent after reboot. So you will need to run it again if you reboot the tab. This doesn't really bother me cause I only use it for charging in the car and it takes like 30 seconds to type in the script.
Enjoy!
Click to expand...
Click to collapse
how do you make it stick ?
I ask this question in another forum and the result was, it´s not possible (maybe wrong).
By the way, after I enable USB charge, my notebook can´t find my Tab anymore.
Mondfahrer said:
I ask this question in another forum and the result was, it´s not possible (maybe wrong).
By the way, after I enable USB charge, my notebook can´t find my Tab anymore.
Click to expand...
Click to collapse
I found a way to very easily get it running.
download terminal emulator.
Go to system preference of terminal emulator and there is an option to enter initial command to after you start terminal emulator.
so just type in:
su - root
echo 1 > /sys/class/power_supply/battery/force_usb_charging
Whenever you start teminal emulator, it will enable usb charging
I use this app to NTSF http://forum.xda-developers.com/showpost.php?p=13337600&postcount=6

ADB install

I managed to install the drivers but how do I open the shell? I want to access some lost files.
I followed the instructions but adb_usb.ini was nowhere to be found so I had to create it.
I have to control ADB via cmd.exe right? Anyone can guide me?
http://forum.xda-developers.com/wiki/BN_Nook_Simple_Touch/Installing_ADB
http://forum.xda-developers.com/wiki/Android_Debug_Bridge
Ok, to get to a shell on the Nook you have to use a shell on the host computer.
In Windows, a shell is known as cmd.exe, "MS-DOS Prompt" or command.
That's the (by default) black window with text.
You can start a Windows shell through the Program list if a shortcut already exists.
If not, you can start it by holding down the Windows key, hitting "R" and typing cmd.exe in the box.
The little box is in a sense already a shell, but it makes a bigger looking shell.
The program adb.exe is the one that you will run to interact with your Nook.
You will have to either be in the same directory as where adb.exe or else have that directory in your PATH.
There are a bunch of commands that you can use (documented in the second link above).
You must first tell ADB how to connect to your device through either a "connect" (for WiFi) or "usb".
Once you are connected you can issue the other commands.
Code:
adb shell
This will let your Windows shell access a shell on your Nook.
Since this is an entirely different system, the commands are different.
In Windows, to list files you type "dir", in Linux (the basis of Android), you type "ls".
I can get to the directory of adb.exe on command.
I don't get it what am I supposed to do next.
If I run adb.exe it starts to load something and then nothing. The Nook is connected, it has Noogie as it's CWR.
After running adb.exe what do I do? Do I go to the nook directory or something? The thing is that I don't even know if I'm running ADB correctly. I followed everything on the wiki
vdguzman said:
it has Noogie as it's CWR.
Click to expand...
Click to collapse
Um, Clockwork Recovery and Noogie are two separate and unrelated things.
Code:
C:\>adb usb
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
At that point it will either say that it found a USB device or that it didn't.
If it's connected, you can type "adb shell".
On Windows, when you click on the USB icon on the taskbar it will list what is connected.
Normally with CWR you should see two lines, USB Mass Storage and ADB.

[Q] Broken Screen, Need to Enable ADB

Hello all!
I have a Nexus 7 with a broken screen and non-functional LCD (i.e., no backlight or any changes visible on the screen). It has CM10.1 (probably a January build) and CWM (I want to say 5.x, but I don't remember). I had a complex screen unlock password, so I stupidly rebooted into recovery and did a factory reset via ADB. However, this caused the debugging flag to be disabled, hence destroying my ability to control the device through ADB.
Questions:
1) Can someone walk me through the procedure to go from the device's "off" state to CWM?
2) Can someone tell me how to re-enable the debugging switch after mounting system?
Thanks!
I am not sure, but I think ADB in recovery mode is always enabled, so why do you want to enable ADB for the "normal" mode? You can do everything in recovery mode, too.
It works!
AndDiSa said:
I am not sure, but I think ADB in recovery mode is always enabled, so why do you want to enable ADB for the "normal" mode? You can do everything in recovery mode, too.
Click to expand...
Click to collapse
You can do a lot of things in recovery mode, except for setting up applications once they are installed. I wanted to set up a VNC server on that tablet so I can see the screen and click on whatever, and eventually use the device's sensors and antennas for other reasons. On top of that, I was having the stupid issue of not being able to go into recovery again (since you need to scroll through a menu before reaching the "Recovery" option on the Nexus 7).
Anyways, I got it to work now:
To go into "Recovery" mode and enable ADB inside the ROM (I had CM10.1 installed, but it shouldn't matter for most JB roms):
1) Turn the tablet off or check that it is off. Since my screen was broken, I ended up opening it and unplugging/replugging the battery
2) Vol Down + Power button, wait for ~5 seconds
3) Press Vol Down twice, and then press Power
4) On computer, go to "adb shell"
5) Enter the following commands:
Code:
mount /system
mount /data
echo persist.service.adb.enable=1 >> /system/build.prop
cp /data/data/com.android.providers.settings/databases/settings.db /data/data/com.android.providers.settings/databases/settings.db.old
9) Exit adb, enter command:
Code:
adb pull /data/data/com.android.providers.settings/databases/settings.db.old ./settings.db
10) Using any SQL database editor, modify settings.db to change "adb_enabled" to 1
11) Save, exit, and enter command:
Code:
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
Now, you can reboot the device (adb reboot). After a few seconds, you should be able to capture screenshots.
I wrote a little bash script to automate the process, so I can get a (somewhat) moving image (at best, I got 4 FPS )
Code:
while true; do
adb shell screencap -p | sed 's/\r$//' > screen2.png
if [ -s screen2.png ]
then
cp screen2.png screen.png
fi
done
Note that it is "buffered" -- if adb fails for any reason, the code will continue until adb is able to get another image.
At this point, you can start adb shell, and then use the following command to send taps, swipes, keyevents, or text:
Code:
input text <string>
input keyevent <key code number or name>
input tap <x> <y>
input swipe <x1> <y1> <x2> <y2>
Doing this, I was able to get all the way to installing a VNC server. I used Droid VNC Server:
https://play.google.com/store/apps/details?id=org.onaips.vnc&hl=en
Of course, you can choose whatever server you want. Just configure it correctly, and then you can stop the script and access the tablet remotely. Also, remember to disable the screen lock -- it's really annoying to have to swipe on the lockscreen using the command each time.
At this point, I've gone ahead and enabled ADB over WiFi, allowing me to access virtually everything for this device from any location.
Time to build something with my (severely handicapped) Nexus 7!
Thank you for this interesting post!
I wanted to suggest a similar process, but I first I wanted to understand better, what you wanted to reach. Yeah, ADB is a very powerful tool, I do not want to miss it.

ADB Pull Error

I am getting the following error when I try to pull a TWRP backup from my Nexus 4. Can anyone please help?
Code:
remote object '/sdcard/TWRP' does not exist
It doesn't exist there. /sdcard/ is really a symlink. The actual location is /data/media/0/TWRP, but try /storage/emulated/0/TWRP as well.
Next time type "adb shell" to go into the phone, then type:
find / -type d -iname twrp
this will search the entire phone for folders with the name TWRP and list their path.
/ is the root folder of the phone to search in
-type d means search for folders only, leave it out if you want to search for file names
-iname means to search for terms case insensitive
sent from xda premium app
Thanks for the help eksasol. I've tried to pull many different paths and they all return the same remote object does not exist error. I've even tried sudo adb pull, with the same result. I've tried this, find / -type d -iname twrp but, all I get is Permission denied. If anyone else has got some ideas I'd be happy to hear them. Thanks. :good:
If you are using Ubuntu or linux, typing 'find' only search what is in your PC. You get permission denied because you want to search in a root directly that required root permission.
To search for files in your phone, you need to log into your phone by typing "adb shell". TWRP give you root by default, then you can use the find command.
Since you have root by default in TWRP, you don't need to use sudo, also Android do not have "sudo" installed. The correct way to gain root privilege in linux (Android) is by typing: su -
To tell if you have are root, you should see # where your user name is in the command window.
Once you are done finding the path, you need to exit the adb shell in order to make contact with your PC, so just type exit. Only then you can start using "adb pull".
by the way, its "adb pull /data/media/0/TWRP/ \home\username\backup\"
Rememer in linux (Android), it's case sensitive.
OK, I see my mistakes now. I was not exiting adb shell when typing adb pull. Anyway, thanks to your help, everything is working correctly now. Thank you again, I really appreciate it. Now I can flash the 4.4 update safely.
eksasol said:
If you are using Ubuntu or linux, typing 'find' only search what is in your PC. You get permission denied because you want to search in a root directly that required root permission.
...
by the way, its "adb pull /data/media/0/TWRP/ \home\username\backup"
Rememer in linux (Android), it's case sensitive.
Click to expand...
Click to collapse
Thanks for helping me re-learn that linux (Android) is case sensitive

Categories

Resources