A Magisk script to set ADB TCPIP port at startup without bricking my phone? - Magisk

Hi guys. I've got a very old phone (LG K11 2017) running Android 7.1 Nougat. Currently I need to boot my phone, get to my home screen, fire up 'MTK Easy Su' in order to get temporary root access, then launch a terminal emulator and from there set up a port to ADB, stop it and then start it again. All of that is required so I can use SCRCPY over wi-fi.
It does not have the 'ADB over Wi-Fi' option under development options.
It's a chore to keep doing that, and it defeats the purpose of benefiting from the convenience of just leaving your phone away to charge while you're back at the desk and launching SCRCPY from your computer.
So I'd like to make a startup script that:
#1 Sets ADB port to 7612:
setprop service.adb.tcp.port 7612
#2 Stops ADB
stop adbd
#3 And finally, starts it up again:
start adbd
If that isn't done, the phone will just refuse connections from my computer:
~$ adb connect 192.168.1.101:7612
failed to connect to '192.168.1.101:7612': Connection refused
Question is, would that be possible to achieve with Magisk? If so, how?
Thanks in advance.

Came across this post googling the same question. It's may be quite late, but nevertheless you can achieve this by adding your commands into magisk's boot script:
Bash:
cat > /data/adb/service.d/adb.sh <<EOF
stop adbd
setprop service.adb.tcp.port 7612
start adbd
EOF
chmod +x /data/adb/service.d/adb.sh

Related

[Q] Please help me use adb to root JI6 on a mac!!

I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Ok, so if you can see your phone through adb, then you are definitely on the right track. Unfortunately, I'm not really familiar with OS X anymore so I'm not quite sure how to do it. Just sit tight for now until someone who does use a Mac, or has more of a clue then I do can help you out.
But seriously, don't pull your hair out. It won't stay on your head forever ya know...
Edit: oops, just saw this is JI6 (Froyo) not JF6, so I can't help you, but here is a general overview:
from terminal inside Android sdk main directory:
tools/adb devices -> list all devices connected that ADB can see
tools/adb shell -> gets a normal user shell on your phone
tools/adb reboot recovery -> reboots into recovery mode, suitable for update.zip root method
--------------------------------
Place the root update.zip on internal sdcard.
from terminal inside Android sdk directory:
tools/adb reboot recovery
Select the update software option, and you will be done.
laxwillsch said:
I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Click to expand...
Click to collapse
Start simple:
If you open a terminal on the mac, and go to your android SDK tools folder; what happens when you type ADB shell?
Or if you type any of the ADB push commands?
You need to give more detail around what you are seeing for us to help you.
Ok so if I am in terminal and i type in my /android-sdk-mac_x86/tools nothing happens and it just says /android-sdk-mac_x86/tools is a directory. But if I type the same but with /tools/abd it opens the abd command lines, like how to write code. Then when I try to "adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin"
it says "-bash: adb: command not found"
however when I type laxwillsch$ /android-sdk-mac_x86/tools/adb shell
it does give me the drop down $
but when I then try to write the next line of code "chmod 0755 rageagainstthecage-arm5.bin"
it says "chmod: rageagainstthecage-arm5.bin: No such file or directory"
I am stumped I am beginning to think i need to buy a pc as I am very interested in android development and want to learn more, but it seems all the tutorials are run assuming you are on a PC
EDIT** I have downloaded the android SDK started pack, and the 2.2 root pack and they are all in my /android-sdk-mac_x86/tools folder that is directly on my Macintosh HD for simplicity
Do you know how to change directories (cd command)?
The problem is that you are trying to work in one directory, but all your tools are in another.
So change directories to the tools directory:
cd /android-sdk-mac_x86/tools/
now run your adb commands - you may have to type ./adb to tell your mac to look in the current directory for the adb command (that is what ./ means "start here")
Also, try to understand what is happening so you can more easily troubleshoot: chmod is a command to change permissions, and you are running it on the phone. If you can't push the file to the phone, then you can change it's permisssions. I guess you never got rageagainstthecage on the phone, so there is no way to chmod it.
If you can't do this on a mac, a PC is not easier. I use both, and like both, but you need to learn basic commands first - they apply to the mac terminal and the windows cmd prompt.
Getting root means moving in and out of the phone - adb shell - puts you in a terminal on the phone. So you really need to understand cd (change directory); pwd (present working directory - shows you where you are); cp (copy); and know your current path - what the ./ does.
I hope this helps, not trying to sound condescending - maybe practice a linux terminal tutorial would help
Thanks so much, I am at school right now and cant test out all that but you are really helping me understand all this! I will post tonight and let you know how it goes. again thank you
ok so i dont have my usb cable with me but I was playing around with the commands that you suggested and ureka! i finally got to a point where it says "h70-33-65-19:tools laxwillsch$" thats a first! and when i type pwd it shows "/android-sdk-mac_x86/tools" so that means I am working out of the right directory right? and from here I enable usb debugging connect my phone then just copy and paste the codes from the thread correct?
yes, it sounds like you are on the right track. But take it nice and slow when you follow the steps. It is very important that the commands are entered exactly as you see them.
Also, one step tells you to wait for something to run and kick you out of ADB - wait just like it says - takes about 45 seconds but feels like forever.
If you are in the tools directory - just by typing "adb" no quotes will give you whole page of adb commands - if you get a "command not found", then you need to add the ./ and make it ./adb
Hope this helps and again, read the commands step by step a couple times first so you understand what is happening.
In a nutsell, you push the rage file;
change its permissions, run it;
get kicked out of ADB and then open a new ADB shell;
you are now root;
remount the system partition to give you write access when it reboots;
reboot;
push over some files;
change permissions on files you pushed;
reboot;
Some things to know - SU is a command for gaining root access; when you use SU your prompt changes (in adb shell) from $ to #
If you are succesful you should see the SuperUser app listed in your apps.
Done and Done just rooted successfully couldnt have done it without you! thanks so much

Possible New Rooting Method!

Well, this is interesting.
On my Revo4g, all I did was enable USB debugging in internet only mode, and i'm faced with this:
Code:
c:\tools\android\android-sdk-windows\platform-tools>adb shell
# busybox whoami
busybox whoami
whoami: unknown uid 0
#
Looks like there's no need for rageagainstthecage, or any exploits. ADB is run as superuser already! (although for some reason ro.secure is set, and it seems to be ignored, so it possibly may be a bug)
EDIT: Nope, verified. Toggle ADB debugging on and off, and you're root!
This is most definitely not what LG intended, but hey- it works!
Still no signs of fastboot without accidentally erasing recovery or something. Looks like it's left in as emergency-only.
If you're not rooted, try this:
Open ADB shell
Your command prompt should be "$"
Run
Code:
kill `busybox pidof adbd`
Re-run ADB shell, your command prompt should change to "#"
Congrats! You're root.. now you can push "su" and whatnot.
That was strangely easy...
thecubed said:
Well, this is interesting.
On my Revo4g, all I did was enable USB debugging in internet only mode, and i'm faced with this:
Code:
c:\tools\android\android-sdk-windows\platform-tools>adb shell
# busybox whoami
busybox whoami
whoami: unknown uid 0
#
Looks like there's no need for rageagainstthecage, or any exploits. ADB is run as superuser already! (although for some reason ro.secure is set, and it seems to be ignored, so it possibly may be a bug)
EDIT: Nope, verified. Toggle ADB debugging on and off, and you're root!
This is most definitely not what LG intended, but hey- it works!
Still no signs of fastboot without accidentally erasing recovery or something. Looks like it's left in as emergency-only.
If you're not rooted, try this:
Open ADB shell
Your command prompt should be "$"
Run
Code:
kill `busybox pidof adbd`
Re-run ADB shell, your command prompt should change to "#"
Congrats! You're root.. now you can push "su" and whatnot.
That was strangely easy...
Click to expand...
Click to collapse
OKAY... So, I don't need to do superoneclick? And I don't need to go through the painful process of downloading 3-4 programs?
markapowell said:
OKAY... So, I don't need to do superoneclick? And I don't need to go through the painful process of downloading 3-4 programs?
Click to expand...
Click to collapse
Well, if you've got ADB installed, then no you don't need superoneclick, but it's main claim to fame is that it's got all of the tools bundled together.
Stick with superoneclick until I get an easy method put together...
LOL... That's sweet!
Like I mentioned elsewhere... LG wants Verizon to think all is locked down and such but secretly behind its back it is giving us free candy. Like when grandpa and grandma hide money in your room before leaving...
They left in everything needed, we only had to put the pieces together.
Bravo LG bravo... now can we have the source code for this device for 2.2 and 2.3..
Now i'm for sure rooting today, as i already have adb installed. Epic.
So i ran ADB Shell and it automatically gave me "#". I then proceeded to "kill 'busybox pidof adbd' " and it said it did it. Still had "#". I don't seem to have root though. I can't delete bingsearch.apk, can't do anything in setcpu.
When i installed super user from the market, it did say there was an update, so it asked if i wanted to install it. I said yes, and it said an error occurred but it put a zip on my sd card to update the binary and that i need to reboot into recovery and install it.
Any ideas? I don't have cwm yet so i can't exactly do that. Here's how the whole thing went down:
Code:
C:\AndroidSDK\platform-tools>adb shell
*daemon not running. starting it now on port 5037 *
*daemon started successfully *
# kill 'busybox pidof adbd'
kill 'busybox pidof adbd'
[1] Terminated kill "busybox pidof adbd"
#
Nevermind, i just went with super one click and i have root now.
powder007 said:
I then proceeded to "kill 'busybox pidof adbd' " and it said it did it.
Click to expand...
Click to collapse
Those were back-ticks, like this: `` not single quotes: ' '
powder007 said:
I don't seem to have root though. I can't delete bingsearch.apk, can't do anything in setcpu.
Click to expand...
Click to collapse
setCPU will require superuser.apk and a working su. Did you mount the system partition r/w by hand before trying to delete bing? Using this method, you'd have to mount r/w, then push su, etc.
Ah, my bad. I'm semi new to adb. Thanks for pointing that out.
I had the super user app from the market. On root explorer it didn't give me a Mount r/w button, so i knew i wasn't rooted.
The problem with this rooting method is that it's incomplete.
My method gives you entry to a root shell-- it does not "root" your device.
A "rooted" device requires a file in /system/bin/ called "su", which allows normal Android apps to access root functionality on the device.
The method I detail allows you to manually remount /system as r/w and push the required file to the proper location without requiring an exploit.
Once I have some time free from working on the deodex'd rom, and porting CM7, I will make a super-super easy one click root application for windows/linux.
Until then, this thread is mostly for technical reference for devs, and something interesting that I found

possible retail root

not sure if anyone has seen this but i found it posted in another forum dated june 8 (retail launch date) and no one has commented. i dont know enough to try this out my self but looks promising.
Galaxy Tab Rooting Instructions - ADB Method
These instructions provided me with a permanent root workaround when SuperOneClick, run within Windows 7, repeatedly hung "waiting for device". SuperOneClick elegantly automates the ADB method, but for some reason the ADB command "adb devices" fails to recognize an attached Galaxy Tab when run from within Windows 7. The larger problem seems to be that in some situations like mine, ADB simply does not run correctly from within Windows 7, even when one right-clicks on SuperOneClick.exe and runs it as Administrator. Perhaps SuperOneClick would work OK on Windows XP, but I have no idea.
The procedure below uses components from SuperOneClick but runs the ADB server and commands from within Linux. In this environment the ADB command "adb devices" correctly reports the attached Galaxy Tab, and other ADB commands work correctly as well. To obtain the needed SuperOneClick components, download SuperOneClickv1.9.1.zip to Linux and unzip it there. The SuperOneClick.exe (which is a Windows executable) will be ignored, but other files (see below) will be pushed to the Galaxy Tab during the rooting process.
I'm indebted to authors at http://pastebin.com/i234U96k and http://rootingdroid.com/ for the hack below. Note that there is a modification to require no dependence on a "cp" command at the ADB shell prompt. For some reason "cp" is missing in /system/bin on my Galaxy Tab.
As always, attempt using this procedure at your own risk. Be specifically aware that you may not be able to "unroot" your Galaxy Tab after using this procedure--ever! This procedure doesn't back anything up from the unrooted device, so if "unrooting" it requires restoring something from such a backup, I'm (and you're) stuck with a permanently rooted device. This condition may interfere with your receiving certain updates or downloading DRM content in the future.
1) Download and install TitaniumBackup and SuperUser onto your Galaxy Tab from the Android Market. Note that SuperUser may not be necessary since there are sources for this app below. I'm including it at this step because I had previously installed it prior to the steps below.
2) Download and unzip SuperOneClickv1.9.1 into some Linux folder of your choice. You can get it at http://shortfuse.org/?page_id=2 near the bottom of the page.
3) Install Android SDK for Linux x86 into your home directory on your Linux box. You can get it at http://developer.and.../sdk/index.html The ADB server will be located in ~/android-sdk-linux_x86/platform-tools.
4) For convenience, copy from the SuperOneClickv1.9.1 folder above the files Superuser.apk, psneuter, su-v2 as su, and busybox into ~/android-sdk-linux_x86/platform-tools. Note that SuperOneClick seems to provide three different versions of su (su-v1, su-v2, su-v3). The su-v2 version worked for me. Performing this copy simplifies entering the "adb" commands below.
Note that there is an alternative source for Superuser.apk and su at http://www.rootingdroid.com at the "Download" link in Step 2.
5) Enter the Linux directory containing the ADB server with the command
cd ~/android-sdk-linux_x86/platform-tools
6) Plug in the Galaxy Tab to the computer, with USB debugging turned on.
7) Test ADB recognition of the Galaxy Tab with the command
./adb devices
You should see messages indicating the ADB server is starting, and then a message similar to
List of devices attached
100020497aab device
If no device is listed, begin investigating by ensuring that USB debugging is turned on. In my experience, when the "adb devices" command is entered from within Windows 7, no device is listed. Again, I think this is related to the "waiting for device" hang when SuperOneClick is run in Windows 7.
8) Push psneuter to the Galaxy Tab with the command
./adb push psneuter /data/local/tmp
9) Make psneuter executable with the command
./adb shell chmod 777 /data/local/tmp/psneuter
10) Run the psneuter exploit with the command
./adb shell /data/local/tmp/psneuter
The message "property service neutered." should appear indicating success.
11) Test for successful rooting with the command
./adb shell
The # prompt should result.
12) Remount the /system volume rw (by default it's ro), so that files can be pushed to /system, with the command
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
13) Return to the Linux computer command line with the command
exit
14) Push Superuser.apk, su and busybox to the /system volume with the commands
./adb push Superuser.apk /system/app/Superuser.apk
./adb push su /system/bin/su
./adb push busybox /system/bin/busybox
15) Make su executable with the command
chmod 4755 /system/bin/su
16) Remount the /system volume as ro with the command
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
17) Verify that su works with the command
su
You should see the # prompt; type the command
exit
and you should see the # prompt again.
18) Power the Tab down and then power it back up. Run TitaniumBackup, which will ask for root privileges that (hopefully) will be granted. It's a good idea to backup your Galaxy Tab before using your new root privileges!
i take no credit for this. all credit to feral urchin for which ever device this works for retail or I/0 but something tells me its for retail because I/o has had an easier way to root for a while..
I am running windows vista ultimate. Should I try this and see if I have the same bug that has been reported for Windows 7?
I have a new Tab 10.1 Retail picked up today.
give it a try let us know the results please
dsh897 said:
but for some reason the ADB command "adb devices" fails to recognize an attached Galaxy Tab when run from within Windows 7. The larger problem seems to be that in some situations like mine, ADB simply does not run correctly from within Windows 7, even when one right-clicks on SuperOneClick.exe and runs it as Administrator. Perhaps SuperOneClick would work OK on Windows XP, but I have no idea.
Click to expand...
Click to collapse
This might work. I am running Vista Ultimate x64 and my adb does recognize my retail Tab 10.1. See image below.
Now when I execute the command on step 10 I receive this error. . .
"Failed to set prot mask <Inappropriate ioctl for device>"
Suggestions?
4) For convenience, copy from the SuperOneClickv1.9.1 folder above the files Superuser.apk, psneuter, su-v2 as su, and busybox into ~/android-sdk-linux_x86/platform-tools. Note that SuperOneClick seems to provide three different versions of su (su-v1, su-v2, su-v3). The su-v2 version worked for me. Performing this copy simplifies entering the "adb" commands below.
did you put everything in the right directory?
where are you a firefighter? im a medic finishing up fire academy in 2 weeks in sofla
im attempting another angle right now..
i got odin working with my galaxy very quickly i backing up now. but i have a funny idea that i can flash the i/o unlocked bootloader with odin 3 unlock it then gain root and then update everything and then flash clock work.
dsh897 said:
4) For convenience, copy from the SuperOneClickv1.9.1 folder above the files Superuser.apk, psneuter, su-v2 as su, and busybox into ~/android-sdk-linux_x86/platform-tools. Note that SuperOneClick seems to provide three different versions of su (su-v1, su-v2, su-v3). The su-v2 version worked for me. Performing this copy simplifies entering the "adb" commands below.
did you put everything in the right directory?
where are you a firefighter? im a medic finishing up fire academy in 2 weeks in sofla
Click to expand...
Click to collapse
Yes I copied all those files to the correct directory. Only on my windows machine the it is /android-sdk/platform-tools/
I am a firefighter in the Charlotte, NC area. Just got off tour this morning.
Google searching that error as I type. I'll let you know the progress.
dsh897 said:
im attempting another angle right now..
i got odin working with my galaxy very quickly i backing up now. but i have a funny idea that i can flash the i/o unlocked bootloader with odin 3 unlock it then gain root and then update everything and then flash clock work.
Click to expand...
Click to collapse
I would like a backup image to odin if needed as well. How do I do this. I have a slight idea but i don't know the directories to pull?
i just disconnected my odin during dump im screwed at the mobile phone and computer! dunno how to get out
trying both volume rockers now. days downloading and flashing android box
just hold the power button for 10 seconds or just goto recovery mode and select reboot
that should get you back to honeycomb.
yea i got it with the power up then the recovery mode thx
How did you get adb to dump. i am running all sorts of commands and nothing works. some help would be greatly appreciated.
i was using odin3 to dump but it doesnt seem to be working correctly i think because its still locked. my next step is to flash the I/0 bootloader / system but im nervous now after it not correctly dumping (failure to write) it just creates a dummy file.
I am at work i will have to play with at home more. and have more resources
I am at an standstill as well. I don't know much more then what I have done thus far. I admittedly know nothing about Linux user privileges so I was never a help to begin with. The image below speaks for itself.
have you been able to flash anything with odin? i think if we can flash the stock i/o bootloader were set
Nope. Dont you think thats a little balzy without a retail dump to fall back on? Although, i could just exchange the device with best buy if something happens...
Sent from my GT-P7510 using XDA Premium App
haha why i havent done it yet. i cant see to get adb to recognize my tablet anymore i was making progress until now
is this method working ok to root a new retail SGT 10.1? thanks
i tried it and this what i got
"Failed to set prot mask (Inappropriate ioctl for device)"
any suggestions, thanks
neonflx said:
is this method working ok to root a new retail SGT 10.1? thanks
Click to expand...
Click to collapse
Nope. I am stuck. He is stuck. We are stuck.
any other methods to root a retail SGT, i took my XOOM back to Cotsco already

[Q] Kindle Fire HD bricked.

I read up on guides to fixing it, ordered a fastboot cable.
Back story: I stupidly wiped my entire KFHD, OS and all
Still can access TWRP, my question is, can it be fixed? Can i just plug my fastboot cable in and transfer CyanogenMod 10.1 and flash it?
Thank you for you help.
I think i can help you a little bit , did you try the adb sideload option?
if not , the only thing you need to do its send the .zip file via adb sideload and you are done
Use the factory/fastboot cable only to get into fastboot, but don't use it to enter commands or transfer files. Switch cables and use adb to transfer a new ROM to your sdcard
ThatLatinGuy said:
I think i can help you a little bit , did you try the adb sideload option?
if not , the only thing you need to do its send the .zip file via adb sideload and you are done
Click to expand...
Click to collapse
no. my kindle is wiped and I cannot connect it to my pc. It's detected but I can't find the empty folder to put stuff in
EDIT: Googled adb sideload and tried it out, my kindle isn't detected when i use the adb devices command. That's probably why it isn't working.
EDIT2: Fixed, many thanks to ThatLatinGuy.
RaptorYeshua said:
no. my kindle is wiped and I cannot connect it to my pc. It's detected but I can't find the empty folder to put stuff in
EDIT: Googled adb sideload and tried it out, my kindle isn't detected when i use the adb devices command. That's probably why it isn't working.
EDIT2: Fixed, many thanks to ThatLatinGuy.
Click to expand...
Click to collapse
You are welcome , and if you need something else just tell me
Can You Help Me?
I have a similar issue. It looks like the OS has been wiped from my Kindle Fire HD 7. My PC does detect it and I can see folders. They are empty, mostly. On start up I get "Kindle Fire". Then I get to a welcome screen with an android icon. I press start and it sits for a bit then a window pops up saying that there was an error. My PC does not detect my Kindle as ADB and it will not boot up in fastboot.
Rednival said:
I have a similar issue. It looks like the OS has been wiped from my Kindle Fire HD 7. My PC does detect it and I can see folders. They are empty, mostly. On start up I get "Kindle Fire". Then I get to a welcome screen with an android icon. I press start and it sits for a bit then a window pops up saying that there was an error. My PC does not detect my Kindle as ADB and it will not boot up in fastboot.
Click to expand...
Click to collapse
I think we need a little more information.
1. What were you trying to do when the OS disappeared?
2. Do you have a fastboot cable?
3. Did you back-up your Kindle stock images?
4. What do you want to achieve at the end? Stock OS or modified OS or what?
Did you follow the instructions for putting the kindle into ADB mode before the OS disappeared?
calkenneth said:
I think we need a little more information.
1. What were you trying to do when the OS disappeared?
2. Do you have a fastboot cable?
3. Did you back-up your Kindle stock images?
4. What do you want to achieve at the end? Stock OS or modified OS or what?
Did you follow the instructions for putting the kindle into ADB mode before the OS disappeared?
Click to expand...
Click to collapse
as calkenneth said we need more details if you want help , tell us what happened and who did you get wipe your os , then i will do my best to help you
Hi, I have a similar problem and was not sure whether to start a new thread or not.
I had tried rooting the 7HD and it only kind of worked.
It is still working for some things but not Netflix and Amazon video streaming so I would like to go back to the stock ROM. I have tried everything I have found online, and nothing is working. Unfortunately, the root I used did not include adding TWRP.
I just tried adb sideload as mentioned above but the instructions call for v1.0.029 or later and mine is 1.0.026 and I can't find a download link to that later version.
I have a fastboot cable and after four or five tries starting the 7hd, it will boot and stop at the Fatsboot but I can't do anything with it as it appears locked up.
With the standard cable I can see the Kindle on my win7pro-x64.
I have Superuser showing on the 7hd carousel.
When I plug the 7hd in, windows tries to install the drivers and then says, "drivers were not installed correctly. The Device Manager shows Kindle under "Other devices" but it has a yellow question mark.
...and when I run abd shell, it gets started OK, but hen says "Device not found," even though I can see the Folders with Windows Explorer.
Thanks for anything you can offer to get this unrooted.
Harry
I have the exact same problem as the OP, I tried sideloading but all I get is a bunch of gibberish adb related in the cmd window whenever I enter anything, i.e. adb push, adb device, adb sideload same stuff comes up in the cmd window but nothing is sideloaded onto the device. What am I doing wrong ? I was attempting to install paranoid android port, was wiping everything and in my eagerness I wiped the system/OS, can still enter twrp.... a bit of help would be appreciated!
CreamEggKing said:
I have the exact same problem as the OP, I tried sideloading but all I get is a bunch of gibberish adb related in the cmd window whenever I enter anything, i.e. adb push, adb device, adb sideload same stuff comes up in the cmd window but nothing is sideloaded onto the device. What am I doing wrong ? I was attempting to install paranoid android port, was wiping everything and in my eagerness I wiped the system/OS, can still enter twrp.... a bit of help would be appreciated!
Click to expand...
Click to collapse
It would he helpful to know exactly what messages you are receiving...
soupmagnet said:
It would he helpful to know exactly what messages you are receiving...
Click to expand...
Click to collapse
this is the message I recieve, a bunch of commands and explanation as to what adb commands do. :good:
I think either my xda app is glitching or that photo got resized so small the text is unreadable. But I am throwing a guess that the command syntax was wrong so adb threw up its default usage text. BTW here's a tip, instead of screen-shotting your PC, right click in the command prompt and press mark, it will let u highlight the text, when done highlighting, tap enter on the keyboard to copy, then you can paste the text here, preferably in code brackets if there is a lot. I find it funny most people don't know this considering how often most people use copy and paste now days, then again Microsoft didn't exactly label it very well. What exactly did you type into the command prompt?
Sent from my Amazon Kindle Fire HD running CM10.1 Tablet UI using xda-developers app
stunts513 said:
I think either my xda app is glitching or that photo got resized so small the text is unreadable. But I am throwing a guess that the command syntax was wrong so adb threw up its default usage text. BTW here's a tip, instead of screen-shotting your PC, right click in the command prompt and press mark, it will let u highlight the text, when done highlighting, tap enter on the keyboard to copy, then you can paste the text here, preferably in code brackets if there is a lot. I find it funny most people don't know this considering how often most people use copy and paste now days, then again Microsoft didn't exactly label it very well. What exactly did you type into the command prompt?
Sent from my Amazon Kindle Fire HD running CM10.1 Tablet UI using xda-developers app
Click to expand...
Click to collapse
the pic came up small because it is a thumbnail to the larger pic which is in photobucket, didnt want to flood he page with an overly large photo, thanks for the pro tip! didn't know that but it shall come in handy in future.
I typed in adb sideload /pa_tate-3.90-20130801.zip and then got the following:
hope it helps! yes I'm aware my first name is in there, not bothered! )
C:\Users\Wil>adb sideload pa_tate-3.90-20130801.zip
Android Debug Bridge version 1.0.29
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosy
stem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup
archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
Click to expand...
Click to collapse
do I need to provide more detail ? because I'm pretty sure everything you need to know is right there. The OP solved his issue, would of been helpful if he said how?
Everything we need is right there, I'm trying to figure out why its doing that be cause the syntax looks correct to me. I'll do some checking on mine, have to ask, u did put the file your trying to side load in the same folder as the adb command right?
Sent from my Amazon Kindle Fire HD running CM10.1 Tablet UI using xda-developers app
stunts513 said:
Everything we need is right there, I'm trying to figure out why its doing that be cause the syntax looks correct to me. I'll do some checking on mine, have to ask, u did put the file your trying to side load in the same folder as the adb command right?
Sent from my Amazon Kindle Fire HD running CM10.1 Tablet UI using xda-developers app
Click to expand...
Click to collapse
doh!
Its always the simple things we forget to do! Will try it in the morning and let you know! Cheers bub.
I placed the file in the android sdk folder at C:/Android SDK still no joy, keep getting the same message pop up..... is there a specific folder within android sdk it needs to be in ? build tools ? temp ? platform-tools ?
On a side not Amazon has agreed to send me another one. Theyve asked that I return this one after I get the new one, question, would they be bothered if I didn't ? Or would they try to charge me for the price of a second one ? latter option seems more likely imho...
The adb command I believe is in the platform tools folder, put it in there and try it. Also just call amazon and ask them to cancel it and tell them you got it working, I doubt there would be any problems.
Sent from my Amazon Kindle Fire HD running CM10.1 Tablet UI using xda-developers app
yeah I figured it was the platform tools folder, still nothing, I have tried various syntax entries followed the guidelines laid out by twrp for sideloading, still no joy, same bunch of adb commands are displayed after enter.... I do not know what I am doing wrong, this is not my first time working adb or with rooted devices.....

[Q] failed to run "adb" command on the "Terminal emulator"

I have a moto x without root, and I just follow the instruction of wakelock detector. But when I try to run adb command on the Terminal emulator, it just shows "/system/bin/sh: adb: not found". How can I run the command successfully?
lurenja said:
I have a moto x without root, and I just follow the instruction of wakelock detector. But when I try to run adb command on the Terminal emulator, it just shows "/system/bin/sh: adb: not found". How can I run the command successfully?
Click to expand...
Click to collapse
You can't use adb from a terminal on the phone... Only a convected PC. That is the problem. No way around it. Adb is for PC/Mac only.
samwathegreat said:
You can't use adb from a terminal on the phone... Only a convected PC. That is the problem. No way around it. Adb is for PC/Mac only.
Click to expand...
Click to collapse
Quote:
Originally Posted by ahikmat View Post
Wakelock detector 1.5.7, supports KitKat (rooted, also for non-rooted phones with few steps)
New permission added:
[INTERNET] - WLD does not consume any traffic, this permission is needed for adb self connection purpose
([BOOT] - this permission will be added for calculating screen on time for non-rooted kitkat phones)
Starting from kitkat we retrieve wakelock stats from "dumpsys", that is why your phone either needs to be ROOTED or you need to have adb access to your phone itself.
KitKat owners with ROOTED phones
Run WLD, allow ROOT at first run. It is preferred to check "remember it" option
KitKat owners with NON-ROOTED phones
This option takes few steps to accomplish, but this is the only way to see wakelock stats for non-rooted kitkat phones.
In android phones, by default adbd listens to USB port, we need to change it to listen tcpip for establishing adb connection.
for that we need to run "adb tcpip 5555" from PC. For Windows OS, usb drivers need to be installed. http://developer.android.com/sdk/win-usb.html
Install one of these light adb on your PC:
Windows: http://forum.xda-developers.com/show...php?p=42407269
Mac/Linux: https://code.google.com/p/adb-fastboot-install/
Enable "developer option" on your phone (it is in settings window , if you don't see it click "Build version" 7 times on "About" section)
Run "adb tcpip 5555" from command line.
Then install "Terminal emulator" on your phone and run "adb kill-server" , "adb devices" and confirm self-connection.
You can follow these slides for details: https://docs.google.com/presentation...it?usp=sharing
We are working to make single-click PC app.
If you could have better idea to optimize these steps, share it with us! Thank you!
[updated apk]
Big thanks to Sordna for helping to improve WLD and RootTools performance!
Here's the guide, I am just confused with the bold part, can anyone please explain?
lurenja said:
Quote:
Originally Posted by ahikmat View Post
Wakelock detector 1.5.7, supports KitKat (rooted, also for non-rooted phones with few steps)
New permission added:
[INTERNET] - WLD does not consume any traffic, this permission is needed for adb self connection purpose
([BOOT] - this permission will be added for calculating screen on time for non-rooted kitkat phones)
Starting from kitkat we retrieve wakelock stats from "dumpsys", that is why your phone either needs to be ROOTED or you need to have adb access to your phone itself.
KitKat owners with ROOTED phones
Run WLD, allow ROOT at first run. It is preferred to check "remember it" option
KitKat owners with NON-ROOTED phones
This option takes few steps to accomplish, but this is the only way to see wakelock stats for non-rooted kitkat phones.
In android phones, by default adbd listens to USB port, we need to change it to listen tcpip for establishing adb connection.
for that we need to run "adb tcpip 5555" from PC. For Windows OS, usb drivers need to be installed. http://developer.android.com/sdk/win-usb.html
Install one of these light adb on your PC:
Windows: http://forum.xda-developers.com/show...php?p=42407269
Mac/Linux: https://code.google.com/p/adb-fastboot-install/
Enable "developer option" on your phone (it is in settings window , if you don't see it click "Build version" 7 times on "About" section)
Run "adb tcpip 5555" from command line.
Then install "Terminal emulator" on your phone and run "adb kill-server" , "adb devices" and confirm self-connection.
You can follow these slides for details: https://docs.google.com/presentation...it?usp=sharing
We are working to make single-click PC app.
If you could have better idea to optimize these steps, share it with us! Thank you!
[updated apk]
Big thanks to Sordna for helping to improve WLD and RootTools performance!
Here's the guide, I am just confused with the bold part, can anyone please explain?
Click to expand...
Click to collapse
Yeah....did you install adbd? That is the android adb daemon.....
BEFORE you can use adb on an android device (It was never meant to be run from anything but a PC), you must FIRST *install adbd*, AND *run "adb tcpip 5555" from a ***PC****
This enables you to use the adbd daemon. Don't have access to a PC? No can do...
6719
samwathegreat said:
Yeah....did you install adbd? That is the android adb daemon.....
BEFORE you can use adb on an android device (It was never meant to be run from anything but a PC), you must FIRST *install adbd*, AND *run "adb tcpip 5555" from a ***PC****
This enables you to use the adbd daemon. Don't have access to a PC? No can do...
Click to expand...
Click to collapse
Really thanks for the reply, I didn't install the *adbd*, and I find someone said to run "adb remount" from a PC to install the *adbd*, but when I run the command, it shows "remount failed: Permission denied". Is this the right way? or how can I install the *adbd*?
lurenja said:
Really thanks for the reply, I didn't install the *adbd*, and I find someone said to run "adb remount" from a PC to install the *adbd*, but when I run the command, it shows "remount failed: Permission denied". Is this the right way? or how can I install the *adbd*?
Click to expand...
Click to collapse
I suggest asking the person who wrote the guide that you quoted. Good Luck!
Remember to always hit the thanks button under any post where someone helped you, or that provided useful information. :good:

Categories

Resources