(as dhayman11 pointed out, "unknown sources" is in security settings, not developer options. but no luck anyway, like most of the settings app, it also crashes if you try to set it.)
instead, here is an extremely stupid idea that just came to me.
1. turn on adb wifi debugging
2. sideload your favorite terminal, e.g.
http://jackpal.github.com/Android-Terminal-Emulator/downloads/Term.apk
(ok I lied. you will need your desktop/laptop/phone/whatever, exactly 1 time. step 2 will be skipped forever after that 1 time.)
3. fire up said terminal from the settings->applications menu.
4. (LOL!)
$ adb devices
4a. if the above command shows no devices,
$ adb connect localhost
and proceed to step 5.
4b. if the command shows exactly 1 device, e.g. "emulator-5554", proceed to step 5.
4c. if the command shows more than 1 device (wtf?!) then you will need to specify a device of your choice ("-s somedevice") in every subsequent adb command, e.g.
$ adb -s emulator-5554 <whatever>
$ adb -s localhost:5555 <whatever>
etc.
5. e.g.
$ adb install /sdcard/Download/foobar.apk
$ adb shell
$ adb uninstall -k com.something.somethingelse
etc. etc.
6. profit? profit!
ok here is a slightly-less incoherent form of the senior-moment-reply I posted earlier
several days ago it occurred to me to alternatively use sshd for terminal access, because:
-a) I feel a little unsafe leaving adb wifi enabled all the time (ok it's only a small thing to turn it on and off, but still) - and for security reasons there is no way to enable/disable it programmatically e.g. from a script/shell/terminal/app (well theoretically this is not exactly true, but practically it is)
-2) some people (i.e. me) would like to do shell/terminal remotely sometimes, rather than on the AFTV (and other people don't have/want a keyboard)
ssh access makes a great alternative to Term.apk, but the problem is:
- Term.apk and/or (pick your favorite android ssh server) don't have permission to run e.g. "pm install foo.apk" - it will fail. (btw 'pm' is a great command, take a look sometime at all the options. it shares a lot of functions as the adb command itself. 'am' is another fun command...)
- so, the hilarious workaround of enabling adb wifi, "adb connect", and then finally "adb shell" or "adb install" etc., is still required. (b/c the adb user is in the 'shell' group, among others - giving it permission to run /system/bin/pm) - oh well.
for random reference:
Code:
127|[email protected]:/ $ id
uid=2000(shell) gid=2000(shell) groups=1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
[email protected]:/ $ exit
[email protected]:/ $ id
uid=10009(app_9) gid=10009(app_9) groups=1015(sdcard_rw),1028,3003(inet),50009(app_40009)
(also note it appears the adb shell user might possibly have 'mount' abilities, but since the /dev/block/sd* nodes permissions' are really locked up, who knows...)
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
I've searched a lot, but did not find a solution.
When I connect my HTC Kaiser with Android Ion 1.5 on the top to my Linux box (all UDEV settings are as recommended), the adb utility (launched as root) does not recognize it correctly. It shows a set of questionmarks instead of the device name:
Code:
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
???????????? device
adb basic commands (pull/push/install/shell) work, though, but DDMS does not work and I can't debug my application when the device is attached.
Does somebody have a solution?
You need to run the adb server as root. Use su or sudo to run these:
Code:
./adb kill-server
./adb start-server
You can then use adb and ddms as a normal user. If you use fastboot, you may find you need to run that as root as well.
it is root
Super Jamie said:
You need to run the adb server as root. Use su or sudo to run these:
Code:
./adb kill-server
./adb start-server
You can then use adb and ddms as a normal user. If you use fastboot, you may find you need to run that as root as well.
Click to expand...
Click to collapse
Like I mentioned in my question - I do run adb as root.
When it's launched not as root, I can not even do "adb shell" and
"adb devices" shows:
"????????????? Permission denied". So, it is root, I assure.
BTW, on my work Windows 2k3 machine I can use ddms, but
"adb devices" still shows some garbage letters instead of the device name.
Sorry for my English, if my explanation is not clear.
ADB COMMANDS
This is just a simple guide on how to open up and run adb commands from your windows based operating system.
Open up run by simultaneously pressing the windows flag key and r.
In the window that pops up type cmd. Now command prompt is open
type the commands each followed by the enter key: cd\
cd androidsdk/tools
Now your in your in your androidsdk/tools folder. You can do several things in here but i'll start with some basics each
of the following commands is to be followed by the enter key
adb devices (this lets you know what devices are attached to the computer in usbdebugging)
How to get your logcat (this will put your logcat in txt format in your sdk tools folder)
adb logcat > logcat.txt
copy an app from your phone to your computer
adb pull /system/app/whatever.apk C:\ateam (replace whatever.apk with the app your pulling also replace ateam with the
folder your placing the app in
Install an app from your computer on your phone
adb install whatever.apk (put an apk in your sdk tools and replace"whatever" with the name of the apk and it will install it)
also you can add either -r or -s to reinstall or install on the sdcard for instance: adb install -r Rosie.apk
this command will reinstall the new rosie from your tools file and still keep the same user data as before.
-r for reinstall
-s for sdcard (gotta test this)
Push an app from your computer to your phones filesystem (in some cases also installs)
adb remount
adb push whatever.apk /system/app (put an apk in your sdk tools and replace "whatever" with the name of the apk and this
will push it to your system app folder. You can change the destination as well for example: You want to push Launcher2.apk
to your data/app folder: adb remount
adb push Launcher2.apk /data/app )
Remove an app from your phone
adb remount
adb shell
cd /system/app (this will change your disk to system/app you may also change to another folder as well)
ls -a ( a list will show of all the apps inside your system app folder)
rm whatever.* (replace the whatever.* with the name of a apk you want to remove )
Flash a recovery image to your phone
First pace the recovery image in your sdcard root and rename it to recovery (so the full name will now be recovery.img)
adb shell
flash_image recovery /sdcard/recovery.img (wait till this# sign shows up again before you type the next command)
reboot recovery
get your current battery level
adb shell cat /sys/class/power_supply/battery/capacity
get your current rom build
adb shell getprop ro.build.description
Reboot into fastboot ruu
adb shell reboot oem-78
How to run the ruu via adb
First thing first start the ruu give it permissions and so fourth
When it gets to the part where it says "Follow the instructons below..."
Move the ruu window out of the way and start your task manager
Go to processes right click on ARUWizard.exe and choose open file location
A new window will open scroll till you see ROM.zip
Copy and paste Rom.zip to your desktop
Once you have copied it to your desktop shutdown the ruu and task manager
Click start menu then click computer
A window will open up click the c drive
now click create new folder and name it test
put the rom.zip in the test folder
plug your phone in and open command prompt and type
Code:
adb devices
adb shell reboot oem-78
fastboot devices
fastboot getvar boot-mode
fastboot erase cache
fastboot flashzip C:\test\rom.zip
fastboot devices
fastboot getvar boot-mode
fastboot reboot
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
sandboxlove said:
i think its a great idea, we need a more compilied list to refer to
add more!!!!
Click to expand...
Click to collapse
I'm going to try to add one everyday. tomorrows lesson how to run the ruu from adb
Powers16 said:
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
Click to expand...
Click to collapse
Where? Pagelink
http://forum.xda-developers.com/showthread.php?p=5799939#post5799939
but its a less in depth reference so i hope this gets added into the tutorial section as here are no in depth tuts about adb in there..
also to remove apk
adb shell rm /system/ (then put in either app or media or what ever folder name /whatever.apk
Papa Smurf151 said:
also to remove apk
adb shell rm -r /system/ (then put in either app or media or what ever folder name /whatever.apk
Click to expand...
Click to collapse
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
This is great, I will be coming back for more.
Thanks a lot
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
thanks...i knew that but wasnt paying attention. I just copied and pasted from my adb notepad file. i edited my post and removed the -r
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
LOL, yeah, I've done that
Might want to also include a note that says when using linux or mac shell you replace the "adb" with "./adb" (I believe that is correct or at least what I do now when reading the windows cmd guides)
tejasrichard said:
LOL, yeah, I've done that
Click to expand...
Click to collapse
I wiped out 16 years of source code with it once....I got fired.
Kcarpenter said:
I wiped out 16 years of source code with it once....I got fired.
Click to expand...
Click to collapse
Oh damn that's crucial man. Hope they had backups
Screwin around
So I was screwin around with adb tryin to learn this stuff and I stumbled across this by just typing adb after cd'ing in. Hopefully its useful. Mind you I am a total noob to android/linux and this was a total accident. I am sure you all know about it though. Useful info though
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>cd\
C:\>cd android-sdk-windows
C:\android-sdk-windows>adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device.
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 running.
-s <serial number> - directs command to the USB device or emulator with the given serial number. Overrides ANDROID_SERIAL 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
disconnect <host>:<port> - disconnect from a TCP/IP device
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
(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 install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal 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 help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
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 specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloade 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 the 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.
C:\android-sdk-windows>
Hi, I'm abcdfv, and I approve this thread.
abcdfv said:
Hi, I'm abcdfv, and I approve this thread.
Click to expand...
Click to collapse
LOL Thanks
I've always been an advocator of EVERYONE learning the ADB basics at least.
updated with run the run the ruu via adb commands
I'm trying to flash my recovery image. I need help. What is the first comand I type at C:\Windows\System32> normally I type cd:\android-sdk-windows\tools
then i adb remount, then adb shell. When I do that now I get "remount failed: Invalid argument" I'm not TOTALLY clueless, although it may turn out that I am after this. any help would be great. I am booted in recovery, but since my recovery image is gone, its just an exclamation in a triangle. if i adb devices, i can see my phone and it says i'm in recovery. Thanks.
I need some serious help with this.....do you need to download anything on your computer?? can you explain all the stuff you need to do leading up to what you type into command prompt...anyone..i need help..i flashed darchstar froyo build and the recovery is all messed up..i cant flash anything..so i need to push a new recovery img.but i don't know anything about adb shell or anything .....please........ive never had to push anything..everyone always just puts flashable zips out for you...HELP
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
I've been primarily following the instructions available at http://forum.xda-developers.com/showthread.php?t=1443071, however I've run into some basic issues.
When I run BurritoRoot3 (verified off the big red 3 in the app), the app does not give me a "root" option and immediately opens a dialog box requesting me to "run /data/local/tmp/BurritoRoot3.bin --root" through adb to start the process?"
I have the kindle device listing in "adb devices" as "7A7C002600000001 device"
I try to run the command listed and get an error that the bin file does not exist.
"adb reboot" does reboot the device
"adb root" gives me "adbd cannot run as root in production builds"
the one automatic script for mac & 6.2.2 keeps giving me "error: device not found" errors.
-----
Everything I can find to test the computers install of ADB seems to verify that its working correctly and my forum searching + google search skills are failing me: anyone know some forum threads that cover this?
- the app does not give you a root option - it only guides you what to do
- have you followed all steps ?
adb shell chmod 777 /data/local/tmp
adb install BurritoRoot3.apk
<go open the app now>
adb shell /data/local/tmp/BurritoRoot3.bin --root
adb shell /data/local/tmp/BurritoRoot3.bin --install
maybe you have to do the adb commands with ./ in front (eg ./adb whatever)
t4nn3d1n said:
I've been primarily following the instructions available at http://forum.xda-developers.com/showthread.php?t=1443071, however I've run into some basic issues.
When I run BurritoRoot3 (verified off the big red 3 in the app), the app does not give me a "root" option and immediately opens a dialog box requesting me to "run /data/local/tmp/BurritoRoot3.bin --root" through adb to start the process?"
I have the kindle device listing in "adb devices" as "7A7C002600000001 device"
I try to run the command listed and get an error that the bin file does not exist.
"adb reboot" does reboot the device
"adb root" gives me "adbd cannot run as root in production builds"
the one automatic script for mac & 6.2.2 keeps giving me "error: device not found" errors.
-----
Everything I can find to test the computers install of ADB seems to verify that its working correctly and my forum searching + google search skills are failing me: anyone know some forum threads that cover this?
Click to expand...
Click to collapse
You have to make sure that you do this command:
adb shell chmod 777 /data/local/tmp
Otherwise it will not make a "BurritoRoot3.bin" file, which means no root.
Install the BurritoRoot3.apk on your kindle, and go into the app.
After that is finished, input:
adb shell /data/local/tmp/BurritoRoot3.bin --root
Then:
adb shell /data/local/tmp/BurritoRoot3.bin --install
I found http://forum.xda-developers.com/showthread.php?t=1410223 which has that chmod command in it. Naturally I found that thread 10 minutes after I posted and was so dumbstruck with myself that I didn't post a reply to my own post.
The device is rooted now and I installed the Alpha Release of MIUI 4.0.? and naturally a few things don't work. Trying again with MIUI's 2.3 stable release (don't know the version number off the top of my head)
Thanks for the quick reply and looking out