Related
ok... so, I've loaded my custom ROM and it contains busybox... I do like the extra functions that busybox offers over the stock Android "toolbox", so I don't really want to disable the commands like ls... I'd just like to turn the colors off.
Here's what I've found in my researches...
1) I can always
Code:
ls --color=never
but that is a lot of extra typing that I'm just not willing to do.
2) I can now SSH into my phone with putty and the colors are nice... but if I'm doing this over the cell modem (even EVDO), it's not too responsive (probably has some to do with currently running applications, syncs, and so forth)
3) I can use Droid Explorer and open a command shell from there, and the colors are nice... but Droid Explorer takes a lot longer to load than adb shell and the nice thing about being at my command prompt is if I need to push, pull, or remount (I understand I can always manually remount,rw and remount,ro from any shell, but adb makes it really easy to do with less typing) quickly... I can exit out of the shell, do the command, and go right back into the shell.
4) I can use Better Terminal Emulator on the phone... again... colors nice (I think you're seeing a theme here) but the typing is excruciating for long commands, and God forbid you make 1 typo... for quick things it's cool and to do a command while not at my computer, it's great.
5) If I were running Windows 95 (or maybe even XP), I could just use ansi.sys and do it. However, I've found that the only way ansi.sys works in a command prompt is to use COMMAND.COM and not CMD... plus you have to set CONFIG.NT to "dosonly" mode and include the driver in there... the biggest problem with all that is that adb will NOT run in DOS only mode. I even tried to adb shell from within a Cygwin command prompt (that already has colors enabled) but all the ansi color codes were lost.
So.... Here's my dilemma... I want colors when I'm not coming in through the Windows command prompt and adb shell. However, I want to disable the colors when I'm coming in through adb shell. I would probably settle for a different way to shell in from Windows 7 than the ones listed above.
I think I remember from my freshman year of college when they tried to teach me Unix, that you can set "default" command line switches for applications. For example, if you always wanted ls to do -l, then someplace you could set that as a default. I read on another post (possibly another forum) that somebody suggested editing .profile to do an alias of a command... something like
Code:
alias dir='ls --color=never'
but the problem with that is there's no .profile and there's no home directory for root or shell.
I even read that the standard ls uses an environment variable LS_OPTIONS, but I don't think that the stock Android ls uses it, and I can't get busybox to use it - plus, it'd be a pain to type that in every time I do an adb shell.
Does anybody have any suggestions or tips or any way to do this? If the alias will work, I'd be happy with that. I could then set dir to no color and keep ls with color. I could maybe even remap a command to do a ls -l all the time.
Thanks in advance.
This was what I ended up doing under Windows 7: http://softkube.com/blog/ansi-command-line-colors-under-windows/
This works for me:
Code:
export LS_COLORS=none
ls
Hey Guys,
I Clockwork3'd my Aria, but I wanted to update my sources (thread 730398) so I can get non market apps. When I follow the instructions in that post I get an error:
Code:
./adb remount
remount failed: operation not permitted
'adb devices' does show my Aria's SN, I'm su'd and I'm running in debug mode. I also chowned everything in the android sdk tools and its subdirectories.
Here's the question -
In searching, I found (thread 614645) that suggested ro.secure wasn't set properly, and sure enough if I do:
Code:
./adb shell
$ getprop ro.secure
1
$
Shouldn't applying clockwork have set that properly? Would the instructions at (thread 8041739 post 9 ) be the right steps to resolve this on an Aria?
Thanks!
PS - sorry I can't post direct links.
if you have all the drivers installed, it should work...
which OS are you using?? (Mac, Win7, etc)
dont rund SDK command in Clockwork, with phone on connect data cable and select "charge only" when asked.
the ./ command is used for Linux i think, i never got that command to work either. just go to the folder where SDK/Tools is located in CMD prompt or Terminal(depending on the OS) and run the following command:
adb remount
hope this helps a bit
I had a lot of issues with driver installs on Windows 7, so I'm doing this on a netbook with Ubuntu netbook remix. Also tried the reflash CD, similar issue.
Right, so with Ubuntu, and the cable my phone came with (have tried a few others just in case)
1. phone on and operational
2. plug in to laptop
3. phone gives happy USB connected and Charge Only notifications
4. fire up terminal window, and su
5. type ./adb remount
and I get the error above. If I do kill-server to refresh it, I get the demon starting successfully on port 5037.
Yeah, I was hoping I'd just missed something stupid. Should I need to modify the boot.img file outside of what Clockwork did?
My symptoms match those described in thread 685146 post #3, however, I've only applied Clockwork (which seems to work) not done anything else funky.
I have my windows 7 machine at the same point now -
adb remount gives 'remount failed: operation not permitted'
and
getprop ro.secure at the adb shell returns 1.
I think this means there's something wrong on the phone, if both machines act the same.
One other data point, I noticed the new Superuser Permissions app that installing clockwork gave me is asking to give superuser permissions to /system/bin/sh when I try to run the adb shell, but it doesn't trigger that when I do the adb remount.
Not sure what this means, any ideas most welcome - TIA!
steps here fixed it, thanks - http://forum.xda-developers.com/showthread.php?t=730398
Ok. I had the android sdk installed before and was able to easily "adb shell" "su"
but a few months ago my phone stopped being recognized by the pc (stock cable) so i uninstalled it since i couldnt use adb nor odin (i thought it was my phone though)
but now i got a BB cable and the drivers all installed wonderfully and there was no headaches so now i believe the hype with getting a new usb cable because the stock one sucks.
So i followed the "Setting up Android SDK for beginners" by bthomas and i ollowed it to a t because i couldnt remember how to set up the sdk, and after setting it up, when i type in adb shell, it gives me a "~#" (which never happened before) and then when i type "su" it gives me a "sh-3.2#"
Im not sure what couldve went wrong except for the fact that before i would install everything (1.5sdk, 1.6, etc.etc) because i didnt know any better, but the guide showed me that all we needed to get adb to wrok was the platform tools one, but its not working.
I need advice because i dont wanna mess up anything in my phone since ive never seen those prompts
TL;DR
ADB gives me a "~#" when i adb shell, and i dont know why
Also, im running urban regeneration with genocide 2.0
The '~' means you are in your home directory. The '#' means you already have root so the 'su' command is not necessary. Sounds like your rom has a non-stock shell installed and is kernel rooted?
machx0r said:
The '~' means you are in your home directory. The '#' means you already have root so the 'su' command is not necessary. Sounds like your rom has a non-stock shell installed and is kernel rooted?
Click to expand...
Click to collapse
but i cd to the sdk directory (Cd:/ android/sdk/platform-tools) so idk why it would think im still in the home directory (that would be cd: users/etc, right?)
and yes the kerna is rooted. its Genocide v2.0 and im undervolted.
im also ext4 if that makes a difference...as for the rom idk its Urban Regeneration
im such a noob now i never had problems before i was forced to stop using my phone with my pc
A_Flying_Fox said:
but i cd to the sdk directory (Cd:/ android/sdk/platform-tools) so idk why it would think im still in the home directory (that would be cd: users/etc, right?)
and yes the kerna is rooted. its Genocide v2.0 and im undervolted.
im also ext4 if that makes a difference...as for the rom idk its Urban Regeneration
im such a noob now i never had problems before i was forced to stop using my phone with my pc
Click to expand...
Click to collapse
After you 'adb shell' it's showing you the filesystem on the phone, not your computer. I assume the the cd platform-tools command you are mentioning is what you are doing in a Windows command prompt to get to where your adb.exe is located.
Edit: Do this, it's safe, 'pwd' shows your current directory (in Linux/Android)
adb shell
pwd
cd /
pwd
Chances are it will show your home directory and then /
http://en.wikipedia.org/wiki/Pwd
machx0r said:
After you 'adb shell' it's showing you the filesystem on the phone, not your computer. I assume the the cd platform-tools command you are mentioning is what you are doing in a Windows command prompt to get to where your adb.exe is located.
Edit: Do this, it's safe, 'pwd' shows your current directory (in Linux/Android)
adb shell
pwd
cd /
pwd
Chances are it will show your home directory and then /
http://en.wikipedia.org/wiki/Pwd
Click to expand...
Click to collapse
yeah adb.exe is in platformtools
but anyways, this is what happened
adb shell
~# pwd
pwd
~ # cd /
cd /
~ # pwd
pwd
/
and then i exited lol
could it be a problem with my computer? like the place i saved it or something?
A_Flying_Fox said:
could it be a problem with my computer? like the place i saved it or something?
Click to expand...
Click to collapse
I don't think you have a problem it's just different than what you remember. Probably because of a difference in your mod. The prompt itself can be modified with environment variables (it's the PS# variables, you can look with 'set') so I wouldn't worry about that. My pwd output on stock looked very similar to what you pasted.
My PS# variables on stock:
# set
set
.
.
.
PS1='# '
PS2='> '
PS4='+ '
machx0r said:
I don't think you have a problem it's just different than what you remember. Probably because of a difference in your mod. The prompt itself can be modified with environment variables (it's the PS# variables, you can look with 'set') so I wouldn't worry about that. My pwd output on stock looked very similar to what you pasted.
My PS# variables on stock:
# set
set
.
.
.
PS1='# '
PS2='> '
PS4='+ '
Click to expand...
Click to collapse
i typed that in and i got a whole list of things and under them PS1='\w \$ '
PS2='> '
PS4='+ '
PWD=' '
TMPDIR= '/data/local/tmp
how would i get it back to #? Im willing to go back to stock odin if i have to, but im getting more intrigued by this as you help...
A_Flying_Fox said:
i typed that in and i got a whole list of things and under them PS1='\w \$ '
PS2='> '
PS4='+ '
PWD=' '
TMPDIR= '/data/local/tmp
how would i get it back to #? Im willing to go back to stock odin if i have to, but im getting more intrigued by this as you help...
Click to expand...
Click to collapse
Ok so you can see how your PS1 environment variable is different than mine. Depending on the shell you are using it might support escape characters such as \w which should display the current directory and \$ which should show # if you are root or $ if not. Here's some non-Android specific info on the subject http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html (stop at the colors part, no clue about which if any character are supported in the stock android shell, just using to give the basic idea)
To temporarily change the command prompt you could do:
PS1="# "
But most likely your shell has a settings file that sets the default prompt when you login. Unfortunately I do not know where this is located. Going back to stock would certainly undo any custom shells or settings your current rom has set if you don't like it.
i think that directory might be sbin/sh. because it calls to it whenever i enter something like ADB REBOOT it says sbin/sh.: adb not found
but when i type in adb shell
and then reboot recovery, etc it works
i dont think i need to go to stock, i just need to not type certain things before commands i guess...
but thanks alot! youve enlightened me quite a bit hahah i wish i had more thanks to give
Hello,
Thanks for looking at this post! I wanted to post it to the rooting thread, but I'm too much of a noob to have access to developer threads. I searched around (both here and google), but couldn't find any useful info on my problem.
I'll get right to the point. I rooted my Acer A500 (after doing an OTA update to 4.0.3), as per the instructions on this thread:
http://forum.xda-developers.com/showthread.php?t=1546593
Everything seems to have worked well (I have root access, etc), but there is something quirky with Busybox. Every time I type a command in terminal (it doesn't matter which - I use both connectbot and terminal emulator), I get a "precmd: not found" message (even for simple things like directory changes). The odd thing is: the commands work, but I still get the message. For instance, if I ask for a directory listing, I'll get the listing, and at the end, it will say precmd: not found (usually with the name of the command it's referencing, e.g. bash: precmd: not found).
It seems to be looking for it in /system/xbin/bash, but bash is in /data/local; I tried creating a symlink but it didn't work ("link failed Cross-device link"). This is really a nuisance, and I'd like to try installing some linux user-land tools, but I fear the outcome might be disastrous if the busybox tools are misconfigured somehow.
I'd appreciate and help/suggestions. Many thanks.
mdhobbes said:
"precmd: not found" message
Click to expand...
Click to collapse
Connectbot seems to set shell variable 'PS1' to "$(precmd)[email protected]$HOSTNAME:${PWD:-?} $ ".
It means your shell (the busybox's ash applet) will try to use output from 'precmd' as a part of a command prompt.
So when 'precmd' was not provided, error messages will be generated wenever a prompt was to be shown.
Though the messages should be safe to ignore, you may get rid of them by setting something harmless to PS1 like:
PS1="> ", or reset PS1 by:
unset PS1from your (busybox) shell.
# The same method should work for terminal emulator.
precmd is a shell function.
To display it run this from the default shell:
Code:
typeset -f
You will see something like
Code:
function precmd {
typeset e=$?
let " e " && print -n "$e|"
}
If you add that to one of your shell's startup files (".profile", ".bashrc", etc.) you will have a working precmd.
It works (function runs), but shows nothing neither 0 or error code. What is it?
[edit]
Nvm, my fault, figured it out
These are instructions for rooting Android devices that utilize the RK3066 chipset (Cortex A9 Dual Core, MALI Quad-Core GFX).
I have tested and verified that these instructions work for the UG007 Android-on-a-stick...they *should* work with any other devices that utilize the same USB chipset. I can almost guarantee this will work on the Imito MX1/2 as you can swap ROMS from this device.
(Basically, if you have the right ADB drivers, you should be good to go)
As per every other thread you read on this site - I TAKE NO RESPONSIBILITY FOR ANY DAMAGES YOU MAY CAUSE TO YOUR DEVICE.
This is a fairly risk-free mod, but you know...$hit happens.
Okay. Let's start.
THIS TUTORIAL ASSUMES YOU HAVE ADB AND KNOW HOW TO USE IT, and that you're in a Windows environment. There are numerous places on the web where you can find this info...and I ain't yo mamma.
1. Download all the files attached to this thread.
2. Attach your RK3066 device to your computer via it's microUSB port. You'll need to have it hooked to a display too.
3. Once booted, go to system settings. Under settings > developer options, enable USB Debugging. Under settings > USB, click "connect to computer" (This may vary depending on your ROM configuration. The point here is to have debugging enabled and your computer to recognize the stick in device manager as something other than USB storage)
4. Extract the right drivers for your system (x86/x64)
5. Go to device manager on your computer. Look for the new "unknown device". Right-click, pick "update driver software"., "browse my computer".
6. Browse to wherever you extracted the drivers in step 4. Click Next. Confirm that you want to install.
7. Open a command window in the directory where you have ADB. Type "adb devices". Still nothing, right?
8. Navigate to C:\users\MYUSERNAME\.android, where "MYUSERNAME" is your User Name. (Duh?)
9. Create a file called adb_usb.ini
10. Open it in a text editor. Add the following string and save (This tells ADB to look for our Vendor ID:
0x2207
11. You should now be able to type "adb devices" at CMD and see your device.
12. Now for the fun. Extract the stuff from "pushme" to the same directory as ADB.
13. Enter the following commands (note: The "$" and "#" symbols do not get keyed in):
Code:
adb push psneuter /data/local/tmp
adb shell
$ cd /data/local/tmp
$ chmod 777 psneuter
$ ./psneuter
14. Psneuter should run and close shell when done. Enter MOAR commands:
Code:
adb kill-server
adb devices
adb shell
15. Take a good look. Is there now a "#" sign? Good. You now have root access. You may continue. If not, then proceed to go yell at me in the comments. If yes, then proceed to enter the last batch of commands to make your newfound privileges permanent:
Code:
mount -o remount,rw -t rfs /dev/block/st19 /system
exit
adb push busybox /system/bin
adb push su /system/bin
adb install Superuser.apk
adb shell
# chmod 4755 /system/bin/busybox
# chmod 4755 /system/bin/su
# mount -o remount,ro -t rfs /dev/block/st19 /system
# exit
adb reboot
After a reboot, download a root app from Play Store to see if it worked! I find Root Checker is boffo for this sort of thing:
https://play.google.com/store/apps/...tcheck&feature=nav_result#?t=W251bGwsMSwyLDNd
THANKS/CREDITS:
Aaron Orquia @ Pocketables.com for the original "universal" root method.
AMJtech's tutorial where I found working ADB drivers and the adb_usb.ini bit to get it recognized.
The guy(s) who make Super1ClickRoot for putting all the necessary files in one easy-to-find spot.
Thanks for this tutorial.
A couple of notes:
Wow !! That's a lot of extra steps for you Windows users. Mac and Linux users start at step 11 (but if you are a Mac or Linux user, you already knew that. )
Linux: If the device still does not show up in Step 11, post, and I can help (Hint: It may not be /just/ the udev stuff.)
Is step 13 necessary? adb remount works on mine. (not sure if I had to adb root first or not) but I can have a root shell via adb without psnueter.
If adb remount succeeds, skip step 14, and continue with the 3rd line of step 15.
Linuxslate said:
Thanks for this tutorial.
A couple of notes:
Wow !! That's a lot of extra steps for you Windows users. Mac and Linux users start at step 11 (but if you are a Mac or Linux user, you already knew that. )
Linux: If the device still does not show up in Step 11, post, and I can help (Hint: It may not be /just/ the udev stuff.)
Is step 13 necessary? adb remount works on mine. (not sure if I had to adb root first or not) but I can have a root shell via adb without psnueter.
If adb remount succeeds, skip step 14, and continue with the 3rd line of step 15.
Click to expand...
Click to collapse
Thanks for the input! Yes, yes, I know windoze makes more work. It's also pretty widespread for folks.
For step 13 - I think it depends on the device. It would be nice for others to weigh in and let me know if it's needed. If not, I can totally remove it.
Also, in the other ROM thread, I made, it's even easier to root - you just grab one of the pre-rooted ROMS and drop it in SD card...the system does the rest. Mind you, this is for the UG007.
Links UG007
If you Bluetooth connection is not working properly, try to install this custom ROM: http://blog.geekbuying.com/index.php/category/android-tv-stick-tv-box/ug007/
How to install CWM-based Recovery: http://androtab.info/clockworkmod/rockchip/
Both worked for me. I was able to connect my BT Keyboard/Mouse Pad combo
./psneuter
Failed to set prot mask (Inappropriate ioctl for device) ??
nice tutorial.. while finding the best way to work my ug007 i stumbled upon this thread via armtvtech.com
currently i only knew this tutorial to root the device, but looking at yours ill give it a try first.
digitalhigh said:
Also, in the other ROM thread, I made, it's even easier to root - you just grab one of the pre-rooted ROMS and drop it in SD card...the system does the rest. Mind you, this is for the UG007.
Click to expand...
Click to collapse
you cant install custom roms without flashmode, cant do flashmode without opening device.. or did i get it wrong!? talking about the ug007
actually you can install a custom rom once you are rooted without opening the device, here
Linuxslate said:
(Hint: It may not be /just/ the udev stuff.)
Click to expand...
Click to collapse
ehm.. im still preparing to root, i guess you hint at the android sdk?
if not ill holla back at you and complain why you didnt write it out in first place
but very good to know that i skip alot by "almost" only installing ubuntu to a vm
I may be missing something, but I couldn't get this to work on my UG007
psneuter didn't work for me, gave me an error about 'invalid ioctl' or something. But the strangest thing is that "adb shell" already shows the # in the prompt.
To confirm my suspitions, I also typed "adb root", which returned "adb is already running as root".
So I proceeded with the rest of the instructions. No errors appeared, installed Superuser and I can see su and busybox in system/bin
But when I download root checker it says it wasn't properly rooted. installing terminal and type "su" says permission denied - and that's it.
Am I missing something? I'm new to this rooting thing, so please don't be angry with my noobish questions
I managed to do it - but *not* by following this tutorial.
I used this: armtvtech.com/armtvtechforum/viewtopic.php?t=28 (Cant post links yet, sorry!)
Only ran the "TPSarky-VonDroid-Root" bat, and presto! I had root on UG007.
I even fixed the changing MAC address problem with wlan.ko from armtvtech.com/armtvtechforum/viewtopic.php?f=69&t=632&start=10 (link on page 2). I just copied it to /data/local/tmp, set permissions as rwr--r-- and then used root explorer to copy it to /system/lib/modules - now I have wifi signal every time I boot the device, and don't need to mess with my router config every time
I also manage to get xbox360 wired controller working. xpad.ko on /data/local/tmp and then insmod /data/local/tmp/xpad.ko - just connect the joystick after that, and it will be recognized. Only problem is, after a reboot I have to insmod again.
I tried doing the same thing I did with wlan.ko, but nothing happens - system won't load it on boot. Am I missing something here?
The psneuter is broken
I'm on Linux, running a RK3066, and psneuter gives "Failed to set prot mask (Inappropriate ioctl for device)". Running Ice Cream Sandwich 4.1.1, kernel 3.0.8+, build RK30_anpei10w1am-r4.0.57.20121207, A10-2 cpu.
SLotman said:
I may be missing something, but I couldn't get this to work on my UG007
psneuter didn't work for me, gave me an error about 'invalid ioctl' or something. But the strangest thing is that "adb shell" already shows the # in the prompt.
To confirm my suspitions, I also typed "adb root", which returned "adb is already running as root".
So I proceeded with the rest of the instructions. No errors appeared, installed Superuser and I can see su and busybox in system/bin
But when I download root checker it says it wasn't properly rooted. installing terminal and type "su" says permission denied - and that's it.
Am I missing something? I'm new to this rooting thing, so please don't be angry with my noobish questions
Click to expand...
Click to collapse
Try renaming old "su".
Check permissions on the su and busybox you installed.
MK808, MK809 [model T002], and the MK802 III anyone?
Hi,
Thanks OP for this information.
I have a Samsung S3 [my first android device] which I rooted with no problem, but am a total noob when it comes to these android sticks.
One can say they are very similar, so I wont be completely in the dark. OK, now that we got that out of the way...
Can anyone please confirm whether they have used this with the MK808, MK809 [model T002], and the MK802 III,
I have ordered these from 1 from amazon and 2 from ebay and am expecting delivery shortly, therefore I just want to make sure before I go bricking them one by one...
I notice that they all have RK3066 Cortex A9 chips but are manufactured by different companies. The ones I see on eBay, although they all bear the same code MK8xx, they all look very different! I presume the MK8xx code is a universal model?? just like 80486 was to the PC? given the case does this method work universally?
I intend to set them up with XBMC media centres and to use with a Xbox controller. Any advice on the best way for achieving this would be nice too.
Thanks
:good:
Linuxslate said:
Thanks for this tutorial.
Linux: If the device still does not show up in Step 11, post, and I can help (Hint: It may not be /just/ the udev stuff.)
Click to expand...
Click to collapse
Linuxslate, I have an MK808 that shows up in lsusb as 2207:300a when I put it in "flash mode" but it never shows up via "adb devices".
I got mine the other day and it turned out to be rooted already?
I decided to install SuperSu and that's how I found out it was rooted.
Immediately, installed Busybox, System Tuner Pro and Titanium Backup.
Rob
Rob sent this from his SPH-D710 via Tapatalk
So would this possibly work on this - http://www.zoostorm.com/Products/357-zoostorm-sl8-3305-1030-tablet-pc.aspx
States it's a Rockchip RK3066 Cortex A9 Dual Core 1.5GHz, running 4.1.1 Jelly Bean, quite interested in getting one & root would be a bonus.
psneuter broken
Hello,
the psneuter attached to the first post doesn't do anything to my ug007. I have the same error others have posted here and haven't gotten a reply about.
To unlock, I used the script that's mentioned in a post above, TPSarky-VonDroid-Root. If you google that, you'll find a download link amongst the results.
Thank u very much...:thumbup:
................................................................................................
Linuxslate said:
Try renaming old "su".
Check permissions on the su and busybox you installed.
Click to expand...
Click to collapse
Can you elaborate a little bit what you mean by renaming "su"?
I'm having the same issue..
Both su and busybox are having the same permission -rwsr-xr-x.
Sent from my Transformer Prime TF201 using XDA Premium HD app
I configured one of these at work. Upon using the terminal app and typing in su I got the # sign. They seem to come from the factory rooted already.
Sent from my Nexus 4 using xda app-developers app
ageerer84 said:
I configured one of these at work. Upon using the terminal app and typing in su I got the # sign. They seem to come from the factory rooted already.
Click to expand...
Click to collapse
Not exactly: this particular su can be used only from adb console, or at least that how it was on my tablet. So you need to replace it with a Superuser apk's su to get all features of rooted android. You can get one e.g. from FDroid
--
blog
Not sure what u mean by on your tablet. Android devices don't typically come rooted but I was surprised to have root access via terminal emulator on this stick PC. I just took it out of the box and definitely didn't have to go through the adb interface on a computer to flash superuser or what have you. Is this just me or is this a typical experience with this particular device?
Sent from my Nexus 4 using xda app-developers app