[Q] Couldn't open ADB Shell - Lenovo P780

In recovery mode, I couldn't access shell window by using adb shell command. (Referring to the attached pic)
The device has already be rooted and OS run very well.
I also checked the hierarchy of the system, system/bin/sh does exist.
So what's wrong with it, any advice welcome!
BTW, this adb file works fine with my another mobile featured with Qualcomm CPU, hence is adb file dependent on type of CPU?

Related

[Q] adb push HELP

Lil' Help... New stock SGS2 phone arrived today... I successfully flashed Entropy512's "stock kernel + rooted stock system image" via Odin3 (v1.85). Worked perfect, phone rebooted, now I have root. 2nd step, I extracted the zImage from Codeworkx's CWM tar file (put zImage in same PC desktop folder as my adb.exe files). I want to use adb push to push zImage file to phone so I can avoid the triangle/counter of death. Anyway, I got this error in my CMD window:
C:\Android\android-sdk-windows\platform-tools>adb push zImage /sdcard/zImage
error: device not found
What went wrong? The "phone" and "card" are recognized by windows explorer, but when trying to use adb commands, get "error: device not found"
Thx.
DoctorQMM said:
Lil' Help... New stock SGS2 phone arrived today... I successfully flashed Entropy512's "stock kernel + rooted stock system image" via Odin3 (v1.85). Worked perfect, phone rebooted, now I have root. 2nd step, I extracted the zImage from Codeworkx's CWM tar file (put zImage in same PC desktop folder as my adb.exe files). I want to use adb push to push zImage file to phone so I can avoid the triangle/counter of death. Anyway, I got this error in my CMD window:
C:\Android\android-sdk-windows\platform-tools>adb push zImage /sdcard/zImage
error: device not found
What went wrong? The "phone" and "card" are recognized by windows explorer, but when trying to use adb commands, get "error: device not found"
Thx.
Click to expand...
Click to collapse
Try to start by verifying that adb can see your phone.
type "adb devices" (no quotes)
This should return a number, if not, the phone is not being seen by adb.
If not check drivers, cable, try different usb port.
If it does return a number you are properly connected.
Proceed to:
adb push zImage /sdcard/zImage
adb shell dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
Might need to as su if prompt shows $ instead of #
Try adb remount
i didnt realize so many people cared about a little triangle that you see for about 3 seconds on boot.
DoctorQMM said:
Lil' Help... New stock SGS2 phone arrived today... I successfully flashed Entropy512's "stock kernel + rooted stock system image" via Odin3 (v1.85). Worked perfect, phone rebooted, now I have root. 2nd step, I extracted the zImage from Codeworkx's CWM tar file (put zImage in same PC desktop folder as my adb.exe files). I want to use adb push to push zImage file to phone so I can avoid the triangle/counter of death. Anyway, I got this error in my CMD window:
C:\Android\android-sdk-windows\platform-tools>adb push zImage /sdcard/zImage
error: device not found
What went wrong? The "phone" and "card" are recognized by windows explorer, but when trying to use adb commands, get "error: device not found"
Thx.
Click to expand...
Click to collapse
You're missing drivers or haven't enabled USB debugging. Drivers for USB Mass Storage are built into Windows, drivers for ADB are not. Not sure what the procedure is for installing Windows ADB drivers... It's one of the reasons I almost never use Windows for working with my phone.
I've heard Droid Explorer might come with a drivers package, not sure.
Entropy512 said:
You're missing drivers or haven't enabled USB debugging. Drivers for USB Mass Storage are built into Windows, drivers for ADB are not. Not sure what the procedure is for installing Windows ADB drivers... It's one of the reasons I almost never use Windows for working with my phone.
I've heard Droid Explorer might come with a drivers package, not sure.
Click to expand...
Click to collapse
PDANET is free and simple to install on any Windows based machine. Less than 30 seconds and it recognises every phone I have tried so far. You just need to be sure to get the right one for you OS, 64 or 32 bit.
I sent to my kids that are too lazy to install the Android SDK.....
SNadler said:
Try to start by verifying that adb can see your phone.
type "adb devices" (no quotes)
This should return a number, if not, the phone is not being seen by adb.
If not check drivers, cable, try different usb port.
If it does return a number you are properly connected.
Proceed to:
adb push zImage /sdcard/zImage
adb shell dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
Might need to as su if prompt shows $ instead of #
Click to expand...
Click to collapse
I appreciate everyone's input... OK, here's where I stand:
adb does now recognize phone. After typing "adb devices", cmd window showed my phone in list of devices attached. I then proceeded to "adb push zImage /sdard/zImage... that seemed to work also [cmd window came back with "2544 KB/s (6718048 bytes in 2.578s)]. Next, I typed "adb shell dd if=/sdcard/zImage of=/dev/block/mmcblk0p5" [cmd window came back with "/dev/block/mmcblk0p5: cannot open for write: Permission denied"]
so is still a drivers issue? cable issue? or something else? Thx again
EDIT: one additional clue for all the experts: the zImage is now on my /sdcard. When I type "adb shell", I do get "$" instead of "#" in cmd window... and I know I have root on phone. When I type "adb shell su" in cmd window, I get "Permission denied".
Sometimes the root install won't completely work until you go to the Superuser app once manually. (e.g. in Applications).
Also, another possibility may be that there are two ways to run adb shell:
One is
Code:
adb shell <command>
Where it'll run <command> and then exit
Then there is
Code:
adb shell
<command1>
<command2>
exit
In the second, when you first type "adb shell" you'll get a shell prompt on your phone.
Then you'll type su (this will give you superuser privileges)
Then you run the dd command
Then you should be good.
The difference is: If you have a custom "insecure" kernel, an ADB shell defaults to root privileges. If you have a stock kernel, ADB shell defaults to "mortal user", and you need to manually use su to get root privileges.
Pushing the file to the SD card does not require root, writing the kernel to the kernel partition (mmcblk0p5) does.
Entropy512 said:
Sometimes the root install won't completely work until you go to the Superuser app once manually. (e.g. in Applications).
Also, another possibility may be that there are two ways to run adb shell:
One is
Code:
adb shell <command>
Where it'll run <command> and then exit
Then there is
Code:
adb shell
<command1>
<command2>
exit
In the second, when you first type "adb shell" you'll get a shell prompt on your phone.
Then you'll type su (this will give you superuser privileges)
Then you run the dd command
Then you should be good.
The difference is: If you have a custom "insecure" kernel, an ADB shell defaults to root privileges. If you have a stock kernel, ADB shell defaults to "mortal user", and you need to manually use su to get root privileges.
Pushing the file to the SD card does not require root, writing the kernel to the kernel partition (mmcblk0p5) does.
Click to expand...
Click to collapse
===============
Entropy512... you da man! I'm good to go now. As you recommended, even though I've been using Root Explorer and I know I was 'rooted', had to open SuperUser app on phone... then in the cmd window when I typed "adb shell" I got the "$" prompt. So at the $ prompt I typed "su"... this gave me the "#" prompt. SuperUser App then asked for SU permission acceptance. Then did the "dd xxxxxxxx" command, and it came back with:
13121 +1 records in
13121 +1 records out
6718048 bytes transferred in 2.895 secs (2320569 bytes/sec).
Rebooted phone to recovery, and have the light blue CWM Recovery 5.0.2.3.
Now I'm rooted, have CWM, and no triangle/counter of death. Hope this helps anyone else with a similar situation.
Again, a BIG shoutout to Entropy512, SNadler, jivy26, et al., for your constructive and quick replies. This forum is the best!
DocQ
One last [Q] Do I have to leave the large "zImage" file (6.41mb) in the /sdcard folder, or can it be removed /moved now that CWM successfully flashed?
DoctorQMM said:
One last [Q] Do I have to leave the large "zImage" file (6.41mb) in the /sdcard folder, or can it be removed /moved now that CWM successfully flashed?
Click to expand...
Click to collapse
No need to leave it, although I keep a bunch of various kernels in /sdcard/kernels myself - it's up to you.

How to Root on Mac OSX

Hi,
Did a search and someone said they were able to root with thecubed method on Mac via Terminal, but I've had no luck so far. Are there any other options for us Mac users?
Thanks
BTW I did see some instructions but it only applies to Verizon. I have the international version D802.
Any help would be greatly appreciated.
use virtual machine and use windows?
I haven't found any easy way to do it, other that running bootcamp and windows on the mac..
You can do it via adb just fine on osx (I'm on snow leopard). You can check which commands to run by opening the Windows script as a text document. It's easy to follow what's going on and has sections for each device
xdabbeb said:
You can do it via adb just fine on osx (I'm on snow leopard). You can check which commands to run by opening the Windows script as a text document. It's easy to follow what's going on and has sections for each device
Click to expand...
Click to collapse
I opened root.bat as a text file but as far as how to input the commands I'm not sure what to do as it seems to differs from the video. Sorry I'm not that familiar working with Terminal.
If you could help out that would be great.
Thanks
xdabbeb said:
You can do it via adb just fine on osx (I'm on snow leopard). You can check which commands to run by opening the Windows script as a text document. It's easy to follow what's going on and has sections for each device
Click to expand...
Click to collapse
Ahhhhh! You know Mavericks is free, right? UPGRADE THAT THING!
On another note... same issue w/ me. I ended up rooting it via my PC, but after that you can use Android File Transfer to manage files and load roms and stuff via OSX.
sell ur POS apple and get a pc...?
digitard said:
Ahhhhh! You know Mavericks is free, right? UPGRADE THAT THING!
On another note... same issue w/ me. I ended up rooting it via my PC, but after that you can use Android File Transfer to manage files and load roms and stuff via OSX.
Click to expand...
Click to collapse
Ha! I haven't upgraded because I still feel snow leopard is the best. I don't like how they've integrated so much ios in the last two, and SL is lean/efficient.
If I have some time I'll write down the commands in a reply. Do you have adb already set up?
xdabbeb said:
Ha! I haven't upgraded because I still feel snow leopard is the best. I don't like how they've integrated so much ios in the last two, and SL is lean/efficient.
If I have some time I'll write down the commands in a reply. Do you have adb already set up?
Click to expand...
Click to collapse
Yes already have adb set up. Thanks for this. Really appreciate it.
No problem. What version of the G2 do you have?
---------- Post added at 11:49 PM ---------- Previous post was at 11:48 PM ----------
Ignore that, I just saw you mentioned the international version
OK, here you go:
1) Go here here and here and thank them both for their work...and read their disclaimers about breaking your phone. The same applies here.
2) Download the attached archive and extract the contents into whatever folder you want...for the purposes of this I'll assume you did so to a directory called ~/D802_OSXroot. If you chose a different directory, modify the steps below accordingly. The archive I attached only contains the appropriate file for the international (D802) LG G2, and I used Chainfire's SuperSU instead of the older ChainsDD su binary and apk. While you're at it, go here and thank him.
3) Make sure USB Debugging is enabled on your phone in Settings>Developer Options
4) Connect your phone via usb cable. You'll get the popup asking what type of connection on your phone. Select Internet connection and then Ethernet when asked. You should see the debugging icon in the status bar of your phone
5) Open terminal on your mac
6) To verify that you are properly connected run the following command:
Code:
adb shell "ls -a /"
you should see the contents of the root of your phone...inlcuding a number of init files. If you do, proceed. If you don't, you have an adb/connection problem.
7) Execute the following in the terminal window to go to the directory where the archive has been extracted on your mac:
Code:
cd ~/D802_OSXroot
8) Execute the following to push the loki exploit file to your phone
Code:
adb push ./g2_security /sdcard/g2_security
9) Unplug your usb cable from the phone
10) On your phone go to Settings>Developer Options and disable USB Debugging
11) Re-enable USB Debugging
12) Plug in your USB cable (follow step 4)
13) Verify adb connectivity (follow step 6)
14) Go back to your terminal window, make sure you are still in the same directory with the files from the archive and execute the following commands in order:
Code:
adb shell "mount -o remount,rw /system"
Code:
adb push ./su /system/xbin/su
Code:
adb shell "chown 0.0 /system/xbin/su;chmod 06755 /system/xbin/su;sync;mount -o remount,ro /system"
Code:
adb install superuser.apk
15) Launch the SuperSU app on your phone. It will likely prompt you to update the su binary...let it do so and then reboot your phone. You should be rooted now.
Good luck!
xdabbeb said:
OK, here you go:
1) Go here here and here and thank them both for their work...and read their disclaimers about breaking your phone. The same applies here.
2) Download the attached archive and extract the contents into whatever folder you want...for the purposes of this I'll assume you did so to a directory called ~/D802_OSXroot. If you chose a different directory, modify the steps below accordingly. The archive I attached only contains the appropriate file for the international (D802) LG G2, and I used Chainfire's SuperSU instead of the older ChainsDD su binary and apk. While you're at it, go here and thank him.
3) Make sure USB Debugging is enabled on your phone in Settings>Developer Options
4) Connect your phone via usb cable. You'll get the popup asking what type of connection on your phone. Select Internet connection and then Ethernet when asked. You should see the debugging icon in the status bar of your phone
5) Open terminal on your mac
6) To verify that you are properly connected run the following command:
Code:
adb shell "ls -a /"
you should see the contents of the root of your phone...inlcuding a number of init files. If you do, proceed. If you don't, you have an adb/connection problem.
7) Execute the following in the terminal window to go to the directory where the archive has been extracted on your mac:
Code:
cd ~/D802_OSXroot
8) Execute the following to push the loki exploit file to your phone
Code:
adb push ./g2_security /sdcard/g2_security
9) Unplug your usb cable from the phone
10) On your phone go to Settings>Developer Options and disable USB Debugging
11) Re-enable USB Debugging
12) Plug in your USB cable (follow step 4)
13) Verify adb connectivity (follow step 6)
14) Go back to your terminal window, make sure you are still in the same directory with the files from the archive and execute the following commands in order:
Code:
adb shell "mount -o remount,rw /system"
Code:
adb push ./su /system/xbin/su
Code:
adb shell "chown 0.0 /system/xbin/su;chmod 06755 /system/xbin/su;sync;mount -o remount,ro /system"
Code:
adb install superuser.apk
15) Launch the SuperSU app on your phone. It will likely prompt you to update the su binary...let it do so and then reboot your phone. You should be rooted now.
Good luck!
Click to expand...
Click to collapse
Has anyone tried this method?
Sent from my LG-D802 using Tapatalk
xdabbeb said:
OK, here you go:
1) Go here here and here and thank them both for their work...and read their disclaimers about breaking your phone. The same applies here.
2) Download the attached archive and extract the contents into whatever folder you want...for the purposes of this I'll assume you did so to a directory called ~/D802_OSXroot. If you chose a different directory, modify the steps below accordingly. The archive I attached only contains the appropriate file for the international (D802) LG G2, and I used Chainfire's SuperSU instead of the older ChainsDD su binary and apk. While you're at it, go here and thank him.
3) Make sure USB Debugging is enabled on your phone in Settings>Developer Options
4) Connect your phone via usb cable. You'll get the popup asking what type of connection on your phone. Select Internet connection and then Ethernet when asked. You should see the debugging icon in the status bar of your phone
5) Open terminal on your mac
6) To verify that you are properly connected run the following command:
Code:
adb shell "ls -a /"
you should see the contents of the root of your phone...inlcuding a number of init files. If you do, proceed. If you don't, you have an adb/connection problem.
7) Execute the following in the terminal window to go to the directory where the archive has been extracted on your mac:
Code:
cd ~/D802_OSXroot
8) Execute the following to push the loki exploit file to your phone
Code:
adb push ./g2_security /sdcard/g2_security
9) Unplug your usb cable from the phone
10) On your phone go to Settings>Developer Options and disable USB Debugging
11) Re-enable USB Debugging
12) Plug in your USB cable (follow step 4)
13) Verify adb connectivity (follow step 6)
14) Go back to your terminal window, make sure you are still in the same directory with the files from the archive and execute the following commands in order:
Code:
adb shell "mount -o remount,rw /system"
Code:
adb push ./su /system/xbin/su
Code:
adb shell "chown 0.0 /system/xbin/su;chmod 06755 /system/xbin/su;sync;mount -o remount,ro /system"
Code:
adb install superuser.apk
15) Launch the SuperSU app on your phone. It will likely prompt you to update the su binary...let it do so and then reboot your phone. You should be rooted now.
Good luck!
Click to expand...
Click to collapse
Thanks for this. I'm having an issue at the first step. I have tested adb when I downloaded the SDK and if I direct the command ./adb devices to that specific folder it can read my phone, but just going into terminal and entering adb shell "ls -a /" al I get is -bash: adb: command not found
Also when I connect my phone to the mac I get options on the G2 but none are internet then ethernet. I get: Charge Phone, Media Sync, Tethering, LG Software, Send Images. The Mac does not ask me what connection I want.
ck37 said:
Thanks for this. I'm having an issue at the first step. I have tested adb when I downloaded the SDK and if I direct the command ./adb devices to that specific folder it can read my phone, but just going into terminal and entering adb shell "ls -a /" al I get is -bash: adb: command not found
Also when I connect my phone to the mac I get options on the G2 but none are internet then ethernet. I get: Charge Phone, Media Sync, Tethering, LG Software, Send Images. The Mac does not ask me what connection I want.
Click to expand...
Click to collapse
It sounds like the first issue may just be due to you not having adb set up properly. If you execute "echo $PATH" in terminal and don't see the android/tools and android/platform-tools directories there, that's the problem. You can either set your path variable to include those directories or just edit the commands I listed accordingly.
The second issue may be due to a difference in the D802 rom vs the VS980. The important thing is that USB Debugging is enabled and that you can access your phone via adb. The 802 may not prompt you in the same way, but if you fix your adb setup the commands will work the same. The rooting method listed (which is the same as thecubed method) is predicated on that working properly.
xdabbeb said:
It sounds like the first issue may just be due to you not having adb set up properly. If you execute "echo $PATH" in terminal and don't see the android/tools and android/platform-tools directories there, that's the problem. You can either set your path variable to include those directories or just edit the commands I listed accordingly.
The second issue may be due to a difference in the D802 rom vs the VS980. The important thing is that USB Debugging is enabled and that you can access your phone via adb. The 802 may not prompt you in the same way, but if you fix your adb setup the commands will work the same. The rooting method listed (which is the same as thecubed method) is predicated on that working properly.
Click to expand...
Click to collapse
I think I figured it out. What I did was transfer the ADB icon from my SDK folder into this one. From there I was able to get access to adb inside the D802 folder. I did have to enter the ./adb as opposed to adb though.
As for the LG I selected tethering as that seemed to be the option similar to the internet/ ethernet choice you mentioned.
All other commands worked accordingly.
Binaries updated for SuperUser as well. At this point how do I get into recovery to upload ROMS etc?
ck37 said:
I think I figured it out. What I did was transfer the ADB icon from my SDK folder into this one. From there I was able to get access to adb inside the D802 folder. I did have to enter the ./adb as opposed to adb though.
As for the LG I selected tethering as that seemed to be the option similar to the internet/ ethernet choice you mentioned.
All other commands worked accordingly.
Binaries updated for SuperUser as well. At this point how do I get into recovery to upload ROMS etc?
Click to expand...
Click to collapse
What I did was installed flashify from the market. This app allows you to backup and then flash a new recovery. Make sure you dl the right one for your device!
Sent from my LG-VS980 using Tapatalk

[Q] Running multiple 'adb shell' commands through 'CreateProcess' on Windows PC

Hi All,
This query is about running 'multiple adb commands' on 'single adb shell' opened using CreateProcess.
Currently we are able to run single command on adb shell which is created using CreateProcess API. This works fine.
But our requirement is, opening up of single adb shell and executes set of adb commands on that same shell. (ie., reusing of already opened adb shell for executing further adb commands on it)
Kindly let me know if anyone has an idea on this.
Thanks and Regards,
Sridevi.
joemittu said:
Hi All,
This query is about running 'multiple adb commands' on 'single adb shell' opened using CreateProcess.
Currently we are able to run single command on adb shell which is created using CreateProcess API. This works fine.
But our requirement is, opening up of single adb shell and executes set of adb commands on that same shell. (ie., reusing of already opened adb shell for executing further adb commands on it)
Kindly let me know if anyone has an idea on this.
Thanks and Regards,
Sridevi.
Click to expand...
Click to collapse
Hi, Please let me know If you have figured out anyway. I am also looking for the same. Thanks in advance.
-Balachandar KM

ADB running as Root on Production Builds...

Hey all,
Found the pieces all around the internet, but I am am working on a ROM, and though I would share my steps to enable ADB running as Root, allowing us to adb push/pull /system/app.
1. Download adbd insecure from the Google Play Store, open and select run on Boot and the "insecure" checkbox.
2. Run adb kill-server on your computer.
3. Run adb root on your computer
4. Profit
You can now push/pull/chmod/mkdir in system directories! (However on /system for example, you still need to remount it RW through adb shell first.

Device won't respond to "adb shell wm" even though "wm" exists in /system/bin

Device won't respond to "adb shell wm" even though "wm" exists in /system/bin
I'm trying to change the pixel density on my unrooted RN3P using the "adb shell wm density XXX" command.
I'm running Krexus-CAF ROM.
ADB is set up and working, and I can open a shell on the device.
The problem is that `wm` cannot be found, even though it exists on the device at `/system/bin/wm`. I cannot do this with the "adb shell wm density XXX" command, nor if I open a shell on the device and type "wm density"
The output is:
Code:
~/Library/Android/sdk/platform-tools $ adb shell wm density 400
/system/bin/sh: /system/bin/wm: /bin/sh: No such file or directory
Has anyone had success with this, or can tell me why the "wm" command cannot be found, even though it exists in the directory that the device looks in?
Cheers
DoubleDroz said:
I'm trying to change the pixel density on my unrooted RN3P using the "adb shell wm density XXX" command.
I'm running Krexus-CAF ROM.
ADB is set up and working, and I can open a shell on the device.
The problem is that `wm` cannot be found, even though it exists on the device at `/system/bin/wm`. I cannot do this with the "adb shell wm density XXX" command, nor if I open a shell on the device and type "wm density"
The output is:
Has anyone had success with this, or can tell me why the "wm" command cannot be found, even though it exists in the directory that the device looks in?
Cheers
Click to expand...
Click to collapse
First check for "adb devices". If it doesn't show then check for the drivers. After that set path of adb in windows to default. Try again with debugging enabled.
mehulchirania said:
First check for "adb devices". If it doesn't show then check for the drivers. After that set path of adb in windows to default. Try again with debugging enabled.
Click to expand...
Click to collapse
thank you for taking time out to try help.
i'd just say that your solution isn't what the OP is looking for.
mainly because if you read the post he tried adb shell wm.....
but also tried on the phone inside terminal app typing the command..
i personally don't have a solution but i thought i'd try help you try maybe another suggestion?
for example, i can now go and tell the OP to download and install angry bird or busybox etc but it won't make a difference.
mehulchirania said:
First check for "adb devices". If it doesn't show then check for the drivers. After that set path of adb in windows to default. Try again with debugging enabled.
Click to expand...
Click to collapse
As noted in the question, I can definitely find my device, as I was running the shell on the device with ADB. The problem was that I could not execute `wm`, even though it was listed in the directory.
I ended up switching ROMs, and could use `wm` without issue - I'm not sure what it was about the ROM I was using that meant I couldn't use the files listed.
Oh well.

Categories

Resources