[GUIDE] Basic Unix/Linux command to use with ADB SHELL - HTC EVO 3D

So I have been reading quite a few threads here on XDA, and the one thing I noticed for noobs to linux/unix world is that they are struggling with some basic command once adb shell is gained. I decided to whip out this quick tutorial to help those noobs out to become more of an expert...like me...lol j/k
Here we go:
Prerequisites:
You must know how to invoke a adb shell command already to drop into your phone.
ALL commands in Unix/Linux are case sensitive
For more details, go to this ADB tutorial (very good one): http://forum.xda-developers.com/showthread.php?t=517874
Let's get going:
Once a shell is gained via adb, let's look at some of the basic commands you can do to navigate around the filesystem. Note: you must remove the double-quotes (") for the actual command.
Code:
"cd" = is change directory
to change to any directory, you type: cd dir_name (where dir_name is a full path)
Example: I want to go to /data/local/tmp in my phone, I would do
cd /data/local/tmp <hit ENTER>
You can also use the ".." to go UP one directory.
Example: I'm in /data/local/tmp and I want to go up to /data folder, a command would be: cd ../.. alternatively, if I do cd .. then i'll drop into /data/local folder instead.
Code:
"ls" = list files/directories
to list files/directories within a folder, the command should be:
ls <hit enter> => this will list all NON-HIDDEN file/directories within your CURRENT directory.
ls /data/local/tmp => this will list all NON-HIDDEN file/directories within /data/local/tmp directory.
ls -l => this will list all NON-HIDDEN file/directories within your CURRENT directory, plus additional details. Consider this is like a "Details" view in Windows Explorer.
ls -a => this will list all files/directories (including hidden files) within your CURRENT directory.
ls -la => this will list all files/directories (including hidden files) within your CURRENT directory, plus details.
Code:
"chmod" = change mode
Goes to wikipedia for more details: https://secure.wikimedia.org/wikipedia/en/wiki/Chmod
Most commonly used modes on android phones are:
"755" or "777".
So if you have a root.sh shell script that you downloaded from XDA, and uploaded to your phone and try to execute it with ./root.sh and it said "Permission denied". That means your script does not have the execute permission. You need to do:
chmod 755 root.sh <hit enter>
[B]IMPORTANT: There is *NO* negative sign (-) in front of the mode bit. So it is NOT chmod -755 root.sh[/B]
If you get a "File or directory not found" error, which means you are chmod-ing a file that doesn't exist in your current directory. To execute a chmod on root.sh in /data/local/tmp you do:
chmod 755 /data/local/tmp/root.sh
If you want to chmod an ENTIRE DIRECTORY and ALL files underneath it you do:
chmod -R 755 /data/local/tmp => this will set /data/local/tmp and ALL files/folders underneath it to be 755.
Code:
"chown" = change ownership
Go to wikipedia for details: https://secure.wikimedia.org/wikipedia/en/wiki/Chown
Most common used chown for android is: "root:root" or "root:shell"
Example: if you want to change ownership of root.sh to root:shell then you do:
chown root:shell root.sh
NOTE: the -R (recursive) option is also available for chown.
chown -R root:shell /data/local/tmp
Code:
"pwd" = print working directory
so when you are within a directory and you want to know which directory you are in, then you issue the command:
pwd <hit enter>
The system will reply back with the currently directory you are in.
I'll try to add more if I think of anything else useful, or if you have suggestions, please feel free to add.

so what does it mean to add adb to your path? thats holding me back from temp rooting on my mac. Im a total adb noob clearly.

hockey4life0099 said:
so what does it mean to add adb to your path? thats holding me back from temp rooting on my mac. Im a total adb noob clearly.
Click to expand...
Click to collapse
The easiest way to explain it is that you can run ADB from anywhere...do a search and you can find a more detailed (and more proper) explanation and directions on how to set it up.

hockey4life0099 said:
so what does it mean to add adb to your path? thats holding me back from temp rooting on my mac. Im a total adb noob clearly.
Click to expand...
Click to collapse
What OS are you using?

vboyz103 said:
What OS are you using?
Click to expand...
Click to collapse
mac
______________

hockey4life0099 said:
mac
______________
Click to expand...
Click to collapse
Like I said, do a search on XDA...there's a great guide on how to set up ADB properly. I'll link to it tomorrow when I get on the computer.
-- Sent from my 3VO Shooter --

hockey4life0099 said:
mac
______________
Click to expand...
Click to collapse
If you use mac, open a Terminal, and you should be at your home directory and type:
nano ~/.profile
if the .profile doesn't exist yet, then you'll see an empty.
Put this into the file
PATH=$PATH:/path/to/your/android/platform-tools
export PATH
save and exit out of Nano, and type:
source ~/.profile
then after this type adb and if adb is in your PATH then you see adb help.

Overview Of Permissions via ADB SHELL
Example = drwxrwxrwx
To Check Permission at anytime in ADB just Type:
ls -l
The First character defines the Directory, Link, Binary.
Below are some examples
Example = d---------
d = Directory
l = Link
b = Binary
The next 9 characters define the file permissions. These permissions are
given in groups of 3 each.
The first 3 characters are the permissions for the owner of the file or directory.
Example = -rwx------
The next 3 are permissions for the group that the file is owned by.
Example = ----rwx---
The final 3 characters define the access permissions for everyone not part of the group.
Example = -------rwx
There are 3 possible attributes that make up file access permissions.
r - Read permission. Whether the file may be read. In the case of a
directory, this would mean the ability to list the contents of the
directory.
w - Write permission. Whether the file may be written to or modified. For
a directory, this defines whether you can make any changes to the contents
of the directory. If write permission is not set then you will not be able
to delete, rename or create a file.
x - Execute permission. Whether the file may be executed. In the case of a
directory, this attribute decides whether you have permission to enter,
run a search through that directory or execute some program from that
directory
In addition to the file permission, you can also modify the owner and
group of the file. The chown program is used here and its syntax is very
simple. You need to be the owner of a file or root to do this.
Understanding Owner Permissions:
The first command is for owner ID, the Second Command is for Group ID.
exp. root.root ( First Root is owner, Second Root is Group ).
Chmod 644 some file, Like Build.prop For testing & then Veiw the Resulted Changes!
Refer to the table below as a quick reference.
Command Line for Both would look like this
chmod 644 build.prop = -rw-r--r--
\/
Chmod Guide
0 - ---
1 - --x
2 - -w-
3 - -wx
4 - r--
5 - r-x
6 - rw-
7 - rwx
SH Chown Guide
\/
chown root.root build.prop
root.root = Root
root.shell = Shell
Busybox SH Chown Guide
\/
chown 0.0 build.prop
0.0 = Root
0.2000 = Shell
I'll update the chmod with more with More Complex Commands Later
Side Note:Always set owner ( chown ) before Setting Permissions ( Chmod )!
Hope this Clears up things & is Helpful to everyone
~Eugene373​

Add adb to your path in Windows.
As has been explained above all it does is allowing your adb to be called out from any location.
To set it in windows you will need to add path to your adb.exe file to your PATH in widows XP or CLASSPATH in windows7.
You can find it in start->contro panel->system->advanced.
There is a tab called "Inviromental Variables".
Click on that tab and new window will pop up. New window has 2 field in it. We are interested in bottom field called "System variables".
Windows XP user should look for line with variable "Path".
Click that line and choose edit below. New pop up will apear and you can edit path line in there. You should add path to your adb.exe to that line.
Example.
I did install windows sdk in c:\android\android-sdx-windows so my adb.exe file is in that folder. I did add path to that folder in "Paht" line of system variables. Add path to your adb.exe after semicolon.
;c:\Location\of folder\where you have\adb exe file\
Save changes, apply them. Now you can use call for adb commands from any location.
Widows 7 users.
Same changed need to be appied as for Windows XP.
There is only one difference that that path in Inviromental variables in windows7 is called "CLASSPATH".
Rest is same. Just add the path to folder containing your adb.exe file to CLASSPATH line and you would be able to use adb in any location.
Hope this make sense and will help.

My mac keeps sayin no device but I can access adb from anywhere basically its in my path but won't pick up my phone
Sent from my PG86100 using XDA Premium App

snoopy1e11 said:
My mac keeps sayin no device but I can access adb from anywhere basically its in my path but won't pick up my phone
Sent from my PG86100 using XDA Premium App
Click to expand...
Click to collapse
Make sure your phone is in debugging mode.
ADB won't see phone if debugging is not enabled.

It is on
Sent from my PG86100 using XDA Premium App

I'm a windows user.
Can't think of anything else.
Sorry.

agat63 said:
Make sure your phone is in debugging mode.
ADB won't see phone if debugging is not enabled.
Click to expand...
Click to collapse
If you have USB debugging turned on, you should see a triangle with exclamation mark on task bar. Secondly, try to do this:
adb kill-server => kill off current server first
then
sudo adb devices => u need to enter password
Basically, you are running adb with escalated privilege, sometimes it needs root access.

This is Wat I got
Sent from my PG86100 using XDA Premium App

snoopy1e11 said:
This is Wat I got
Sent from my PG86100 using XDA Premium App
Click to expand...
Click to collapse
hmmm interesting...just wondering if you have your device turned on to be disk usage instead of just Charge Only?
Check on your desktop to see if you SD card had mounted, not sure if it makes a difference but worth a try. Another thought is that maybe your USB port doesn't work?? Did you check your phone to see if you have a triangle with exclamation mark in it on the task bar? (to the left)
Also, try it on a different computer if u can, and if it still doesn't work, afraid urs is defective.

I really appreciate ur help I re did the sudo command and hit "adb devices connect" and my device popped up
Sent from my PG86100 using XDA Premium App

snoopy1e11 said:
I really appreciate ur help I re did the sudo command and hit "adb devices connect" and my device popped up
Sent from my PG86100 using XDA Premium App
Click to expand...
Click to collapse
Ha, interesting cuz I never have to issue that command. Good to know you got it to work.

Related

Nook Tablet Root - MAC Instructions

UPDATE: See my other thread for a much easier solution that does all the hard work for you...
This assumes a factory fresh nook and a mac that hasn't previously been used. I just reset mine again (Hold Power until you get prompted, pick power off, then when it's off, press N and then turn it back on) and went through this. Works reliably.
On the NOOK
Browse to this:
http://www.launcherpro.com/apk/LauncherPro-0.8.6.apk
When it's done, click on notifications center
Press on downloaded apk file
Complete action using package installer
It should say "install blocked"
Press settings
Tick unknown sources (press ok)
Pick Development
Tick USB debugging (press ok)
Tick the other USB debugging further down
Uncheck Automount
Back/Back
On the MAC
Download Android SDK http://developer.android.com/sdk/index.html
Unzip it
Start a shell
Cd to the dir where you unzipped it
cd to tools directory
run ./android - android sdk manager launches
Tick Android SDK platform tools
Click install 6 packages - wait until it's all done. "done loading packages"
Open a new shell
See if there is .android directory in your home directory, if not "mkdir -p ~/.android" in your home directory
echo 0x2080 > ~/.android/adb_usb.ini
adb kill-server
Connect the Nook via MicroUSB to your Mac
The nook should show you notification saying usb debugging connected. If not something's wrong with the settings in the menu earlier
Download http://dl.dropbox.com/u/15069134/Nook&Zergy.zip
unzip that file
Adjust your PATH variable to include the directory containing the adb binary from the sdk, eg:
export PATH=$PATH:YOURDOWNLOADDIR/android-sdk-macosx/platform-tools/
Type which adb
This should show you the full path to the adb binary, if not your path is set wrong, assuming that is right
adb devices
You should see:
List of devices attached
[YOUR NOOKCOLOR SN] device
adb push zergrush /data/local/zergy
adb shell "chmod 755 /data/local/zergy;cd /data/local/;./zergy"
adb wait-for-device install Superuser.apk
adb remount
adb push su /data/local/tmp/
adb shell "cd /data/local/tmp;chmod 777 su;cd /;mount -o remount,rw -t rootfs rootfs /"
adb push su /system/bin/su
adb shell chmod 4755 /system/bin/su
Download http://goo-inside.me/gapps/gapps-gb-20110828-signed.zip
Unzip this file.
cd gapps-gb-20110828-signed/system/app/
rm SetupWizard.apk
adb push GoogleServicesFramework.apk /system/app
adb push Vending.apk /system/app
adb push CarHomeGoogle.apk /system/app
adb push FOTAKill.apk /system/app
adb push GenieWidget.apk /system/app
adb push GoogleBackupTransport.apk /system/app
adb push GoogleCalendarSyncAdapter.apk /system/app
adb push GoogleContactsSyncAdapter.apk /system/app
adb push GoogleFeedback.apk /system app
adb push GoogleFeedback.apk /system app
adb push GoogleFeedback.apk /system/app
adb push GooglePartnerSetup.apk /system/app
adb push GoogleQuickSearchBox.apk /system/app
adb push LatinImeTutorial.apk /system/app
adb push MarketUpdater.apk /system/app
adb push MediaUploader.apk /system/app
adb push NetworkLocation.apk /system/app
adb push Talk.apk /system/app
adb push OneTimeInitializer.apk /system/app
adb shell chmod 644 /system/app/*
Click on Notification center again, and press on the Golancher Icon again. Install the Goauncher
Reboot
After reboot, slide to unlock and it should ask "complete action using..". Pick LauncherPRO
Open Marketplace which should be on the launcher screen
Sign in with your google credentials, attach the device to your account
Install button savior from the Marketplace.
Browse to www.amazon.com/app-email
Click notifications and watch for Amazon appstore apk download
Click and install.
You should now be live with Android Market & Amazon Market.
My word I hope these kind of instructions get captured in a wiki somewhere...
Just what I was looking for, worked perfect first try. My frustrations are out the window, not my Nook Tablet!!!
Sweet. One person helped, my debt is repaid the community
Sweet Indeedie!
Thanks @t-r-i-c-k - you just helped yet another.
Note to others - I did have a problem getting my device listed with adb, I re-ran the tgps_launcher app for the debug settings and un-checked and re-checked USB Debugging lines (2 of them) and that seem to do it. I also re-plugged the USB cable a one point so that may have been part of the trick as well - not real sure. You may have to fiddle a bit.
EDIT: ok running tgps_launcher, it is the first USB Debugging checkbox to un-check then re-check.
---------- Post added at 05:48 AM ---------- Previous post was at 05:09 AM ----------
Ok, just had a bit of a scare after rooting...
I had left the NT in terminal, su'd to root and the display timed out. NOTHING would bring it back to life!! EXCEPT plugging in the USB cable and running 'adb devices' ... and it powered on!! Whew!!!!
(before this I held the power button for a good 30 seconds and tried a repower to no avail)
I tried to replicate but always got my unlock back on no matter what I did?!
Ok so here is where I am getting stuck.
t-r-i-c-k said:
See if there is .android directory in your home directory, if not "mkdir -p ~/.android" in your home directory
echo 0x2080 > ~/.android/adb_usb.ini
adb kill-server
Click to expand...
Click to collapse
I'm pasting the "mkdir -p ~/.android" command into the terminal and it doesn't seem to do anything. No such directory is created.
Perhaps I'm missing something. I'm not as used to using the terminal on my Mac as I am on Linux.
MonkeysInACan said:
Ok so here is where I am getting stuck.
I'm pasting the "mkdir -p ~/.android" command into the terminal and it doesn't seem to do anything. No such directory is created.
Perhaps I'm missing something. I'm not as used to using the terminal on my Mac as I am on Linux.
Click to expand...
Click to collapse
Nope - not the your Nook terminal - do it on your Mac
...assuming you are doing it on your mac...
if you use 'cd' (and [Enter] of course) and you'll be in your home folder ("~")
if mkdir returns an error then it probably already exists - try 'ls -a' and see if you see it.
if it exists then use the echo command again - there is no visible output - it used by adb
MonkeysInACan said:
Ok so here is where I am getting stuck.
I'm pasting the "mkdir -p ~/.android" command into the terminal and it doesn't seem to do anything. No such directory is created.
Perhaps I'm missing something. I'm not as used to using the terminal on my Mac as I am on Linux.
Click to expand...
Click to collapse
It makes a hidden directory in your home directory. ls -lart ~ to see it
Yay!!! It works!!!! It took a bit of tweaking, and a few extra steps (making sure all the directories were right) but it worked. Thanks a lot!
It all seemed to work really well except I got a force close on the google framework when I rebooted. Not sure if I should start from scratch or not. One thing I can't figure out how to do is erase apps that install from the market. Clicking settings brings up the Nook settings which doesn't have any record of the apps I installed via market.
Also, is there any way to enable USB debugging after the reboot? When I plugged in the usb cable again to try to repush the framework I just get usb storage.
Ok, I found a link to the app that lets me toggle USB debugging though I'm getting a permissions error when I try to push. Also figured out that I can uninstall apps through the market app itself.
Thanks very much for the instructions you've posted here.. very helpful!
viniosity said:
It all seemed to work really well except I got a force close on the google framework when I rebooted. Not sure if I should start from scratch or not. One thing I can't figure out how to do is erase apps that install from the market. Clicking settings brings up the Nook settings which doesn't have any record of the apps I installed via market.
Also, is there any way to enable USB debugging after the reboot? When I plugged in the usb cable again to try to repush the framework I just get usb storage.
Ok, I found a link to the app that lets me toggle USB debugging though I'm getting a permissions error when I try to push. Also figured out that I can uninstall apps through the market app itself.
Thanks very much for the instructions you've posted here.. very helpful!
Click to expand...
Click to collapse
I have seen that google services framework crash once too. I just ignored it and everything seems fine. I did notice at least one other person in the main thread who reported the same. I may wipe my device and try the process again, this time with another Launcher too. I also noticed the app store doesnt show everything either. Notably facebook seems missing. If you go right to it from a link you get a "this is not compatible with your device" at the top. Going to play around more after work. On the whole though, this is awesome!
Sent from my BNTV250 using Tapatalk
I've gotten to this spot:
adb devices
You should see:
List of devices attached
[YOUR NOOKCOLOR SN] device
I can see the serial number, but I can't get any farther. This is the error I get: cannot stat 'zergrush': No such file or directory
Any ideas people? I'm brand spanking new to terminal and commands and stuff like this. Thanks for your help.
beatlesfan01 said:
I've gotten to this spot:
adb devices
You should see:
List of devices attached
[YOUR NOOKCOLOR SN] device
I can see the serial number, but I can't get any farther. This is the error I get: cannot stat 'zergrush': No such file or directory
Any ideas people? I'm brand spanking new to terminal and commands and stuff like this. Thanks for your help.
Click to expand...
Click to collapse
You need to be in the directory where you unzipped the zip from dropbox . Do ls -l and you should see the zergrush file, su etc
Sent from my BNTV250 using Tapatalk
Ok I renamed the folder from dropbox "Nookroot" This is what I get. I'm copy pasting "adb push zergrush /data/local/zergy" from first post.
MYNAME-iMac-2:Nookroot emt1052$ ls -l
total 4048
-rwxr-xr-x 1 emt1052 staff 96256 Sep 20 2010 AdbWinApi.dll
-rwxr-xr-x 1 emt1052 staff 60928 Sep 20 2010 AdbWinUsbApi.dll
-rwxr-xr-x 1 emt1052 staff 4229 Nov 21 14:38 NookandZergy.bat
-rwxr-xr-x 1 emt1052 staff 843503 Feb 29 2008 Superuser.apk
-rwxr-xr-x 1 emt1052 staff 578611 Sep 20 2010 adb.exe
-rwxr-xr-x 1 emt1052 staff 413129 Nov 20 21:55 busyboxinstall.apk
-rwxr-xr-x 1 emt1052 staff 14175 Nov 20 13:52 debug.apk
-rwxr-xr-x 1 emt1052 staff 22228 Feb 29 2008 su
drwxr-xr-x 6 emt1052 staff 204 Nov 20 15:57 system
-rwxr-xr-x 1 emt1052 staff 23056 Nov 16 09:09 zergRush
MYNAME-iMac-2:Nookroot emt1052$ adb push zergrush /data/local/zergy
-bash: desktop/android-sdk-macosx/platform-tools/adb: No such file or directory
Sorry if I'm making some dumb mistake, and thanks for your help.
Try this
beatlesfan01 said:
...
MYNAME-iMac-2:Nookroot emt1052$ adb push zergrush /data/local/zergy
-bash: desktop/android-sdk-macosx/platform-tools/adb: No such file or directory
...
Click to expand...
Click to collapse
@beatlesfan01: I wonder if /data/local doesn't exist on your NT - or you don't have permissions...
maybe try (from your Mac shell)
Code:
mac-osx$ adb shell
$ ls /data/local
a) you should get the single '$ ' prompt after the adb cmd - this is the NT's shell
b) you should get no error from 'ls /data/local
If you get errors for /data/local, then try this (while still in the 'adb shell'):
Code:
$ mkdir /data/local
$ chmod 777 /data/local
If you get an error on the 'mkdir' do the 'chmod' anyway - actually the 'chmod ...' may be the only thing you need.
Then try stuff again.
I did the first part and got this:
MYNAME-iMac-2:~ emt1052$ adb shell
$ ls /data/local
tmp
$
beatlesfan01 said:
I did the first part and got this:
MYNAME-iMac-2:~ emt1052$ adb shell
$ ls /data/local
tmp
$
Click to expand...
Click to collapse
*** NOTE EDIT ***
Ok, try 'ls -l /data' and look for 'local'
the permissions should look like '-rwxrwxrwx' - if not try 'chmod 777 /data/local' and try your adb push cmd again.
Got this:
ls -l /data/local
drwxrwx--x shell shell 2011-11-21 16:06 tmp
$ chmod 777 /data/local
$ adb push zergrush /data/local/zergy
adb: permission denied
$
I DO appreciate your help with this.
Based on your last post - you are issuing the adb push command on the Nook.
It has to be issued on the Mac...
beatlesfan01 said:
Got this:
ls -l /data/local
drwxrwx--x shell shell 2011-11-21 16:06 tmp
$ chmod 777 /data/local
$ adb push zergrush /data/local/zergy
adb: permission denied
$
I DO appreciate your help with this.
Click to expand...
Click to collapse
Ok - weird. I did mis type and edited my previous post BUT the chmod should have looked after the permission issue anyway...
Try 'chmod 777 /data' - can you do that without an error - using the 'adb shell'?
EDIT: @rmm200 - thanks - I didn't notice that one

[Q]Root Explorer Multiple Permissions how to?

I was wondering how you can change the file permissions for several files at once in root explorer? I copied the media/audio/ folder from another cm7 build to neutrino and moved all the files to the correct folders. Now there are so many files, i'de like to change multiple file permissions at once.
the easiest way is to use terminal emulator or adb shell, su, then do "chmod 755 *" for permission "rwxr-xr-x" or "chmod 644 *" for permission "rw-r--r--". The permission will apply to all files since wildcard "*" is used here.
You would probably have more luck using a terminal and chmod.
http://www.manpagez.com/man/1/chmod/
Generally it would be something like so:
chmod augo+-rwx <file name or wildcard>
a = all (owner, groups, other)
u = user or owner
g = groups
o = other
+ to add permissions, - to remove them
r = read
w = write
x = execute
Edit:
I'm way too slow...
sspa said:
the easiest way is to use terminal emulator or adb shell, su, then do "chmod 755 *" for permission "rwxr-xr-x" or "chmod 644 *" for permission "rw-r--r--". The permission will apply to all files since wildcard "*" is used here.
Click to expand...
Click to collapse
Your answers gave me idea to use chown through adb shell the same way. And it works! Thanks all.
P.S. Can't understand why no one famous root file managers can't do batch and recursive chown/chmod.
igenid said:
P.S. Can't understand why no one famous root file managers can't do batch and recursive chown/chmod.
Click to expand...
Click to collapse
Hello,
Sorry it's late answer, but was the same problem of you...I disocover that "Total Commander" and it do it perfect.
Thanks to all
Actually Total Commander still does not do it. Change a main directory to a specific user and hit recursively, nothing happens down the directory tree. It is only to change the date recursively.

[How To] Disable Auto-mount on boot

Hi All, just got the NT for a week and has been busy reading and learning. Thanks to all devs that make this into a full tablet.
It's a pain that we have to manually disable the automount each time we reboot NT. So here is a simple fix (Your NT needs to be rooted to use this fix):
Method 1: Using Root Explorer
1. Set /system to read-write
2. open the file /system/bin/clrbootcount.sh in text editor
3. Add the following line at the bottom:
Code:
setprop persist.service.mount.umsauto 0
4. Save and set permissions to 755 (All Read, Top Write, All Execute)
Method 2: Using ADB
Code:
adb remount
adb shell
cd /system/bin
echo "setprop persist.service.mount.umsauto 0" >> clrbootcount.sh
Reboot and see if it works
Note: For 1.4.1 users, please use DeanGibson's method below: http://forum.xda-developers.com/showpost.php?p=22007574&postcount=9
do you add
setprop persist.service.mount.umsauto 0
underneath the word "done" when viewing in root explorer?
promek said:
do you add
setprop persist.service.mount.umsauto 0
underneath the word "done" when viewing in root explorer?
Click to expand...
Click to collapse
Yes. Add it as the last line will do.
Having made this mod, how do you mount for pc accessories sd?
rei901 said:
Having made this mod, how do you mount for pc accessories sd?
Click to expand...
Click to collapse
Use NT hidden settings
Sent from my LT18i using XDA App
thanks it works, confirmed working by using ADB
You don't have to do any of this if you boot your NT from the microSD card.
It works flawlessly.
installed and it works. using root explorer
thanks
Use the provided "hook" file
cobrato said:
Code:
setprop persist.service.mount.umsauto 0
...
Click to expand...
Click to collapse
Why not just put the above line in /data/boot_complete_hook.sh ??? That's what it is for; it's invoked by /system/bin/clrbootcount.sh -- That way, you don't have to modify clrbootcount.sh, and the change will persist across a /system restore or B&N update.
Create /data/boot_complete_hook.sh, with the following as the first line:
Code:
#!/system/bin/sh
Add your "setprop" line above.
Mark the file as executable:
Code:
chmod 755 /data/boot_complete_hook.sh
DeanGibson said:
Why not just put the above line in /data/boot_complete_hook.sh ??? That's what it is for; it's invoked by /system/bin/clrbootcount.sh -- That way, you don't have to modify clrbootcount.sh, and the change will persist across a /system restore or B&N update.
Create /data/boot_complete_hook.sh, with the following as the first line:
Code:
#!/system/bin/sh
Add your "setprop" line above.
Mark the file as executable:
Code:
chmod 755 /data/boot_complete_hook.sh
Click to expand...
Click to collapse
Yes it's better to create boot_complete_hook.sh. In fact I have to do that in 1.4.1 - changing clrbootcount.sh will cause bootloop

[Q] A command to change directory in ubuntu

Hi, if possible how can I change directory in a terminal window in ubuntu using a short command such as 'croot' instead of using 'cd ~/android/system' ??
wassupasian said:
Hi, if possible how can I change directory in a terminal window in ubuntu using a short command such as 'croot' instead of using 'cd ~/android/system' ??
Click to expand...
Click to collapse
not sure what "croot" is? You mean "chroot root:root /to/destination?" "cd ~/ take your logins home folder. You can always cd / for root or cd /etc /bin /sbin or whatever root subfolder from anywhere. but i am unaware of any true short cuts.
hope that helps,
dfl
If the bash stuff is equal to Ubuntu Desktop systems you can do something like this:
in terminal:
Code:
$ echo "alias croot='cd ~/android/system'" >> $HOME/.bash_aliases
logout -> login (reboot i guess)

ADB push alternative from Android device itself (non-rooted)

I have a non-rooted Android device with stock ROM 4.4.2 and I have the following test shell script:
Code:
adb push test.sh /data/local/tmp
adb shell "cd /data/local/tmp; chmod 755 test.sh"
adb.exe shell "sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
If I run this over ADB from PC to my device, it simply works.
Now convert this to:
Code:
cp test.sh /data/local/tmp
cd /data/local/tmp; chmod 755 test.sh
/system/bin/sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
and it doesn't work. It says permission denied on /data/local/tmp.
Is there any other EXT4 place on a non-rooted device that I can do this?
Well, I cd to /data/local/tmp and even submitting a 'ls' command inside Terminal Emulator doesn't work, it says permission denied, but when doing it from PC to Android using ADB it's fine. Is there any workaround for this? I want to be able to do this on the device itself.
Thanks
idoit said:
I have a non-rooted Android device with stock ROM 4.4.2 and I have the following test shell script:
Code:
adb push test.sh /data/local/tmp
adb shell "cd /data/local/tmp; chmod 755 test.sh"
adb.exe shell "sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
If I run this over ADB from PC to my device, it simply works.
Now convert this to:
Code:
cp test.sh /data/local/tmp
cd /data/local/tmp; chmod 755 test.sh
/system/bin/sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
and it doesn't work. It says permission denied on /data/local/tmp.
Is there any other EXT4 place on a non-rooted device that I can do this?
Well, I cd to /data/local/tmp and even submitting a 'ls' command inside Terminal Emulator doesn't work, it says permission denied, but when doing it from PC to Android using ADB it's fine. Is there any workaround for this? I want to be able to do this on the device itself.
Thanks
Click to expand...
Click to collapse
No there isnt, not if you try using /data partition. ADB can read this partition (and that too was added around android kitkat itself for purpose of adb backup
etc). So ADB can read this partition, but terminal emulator and such cannot.
Assuming that you have a great reason to simply not copy the sh file to user-usable internal memory, /system partition is the one place where you can copy things without actually having root (and even access them with terminal emulator, but not manipulate them), and this isn't that simple either. Rather, the method will be device dependent. For instance, if you have a phone like Nexus phones, simply download stock firmware, open/extract it depending on what format it is (img or tar), add your sh file and repack the firmware, then flash it into the phone. The firmware should be same as your current installed so your applications dont mess up. But this method is not only long (and messy if your device has integrity checks on firmware files), but also not possible on some phones (as far as I know).
You can also try copying the sh file with adb to /data/data/com.android.terminal. Then you should be able to access this with terminal emulator (since an app has permissions inside its own data folder). However I have not tested this method and I am not sure it will work.
Besides this, every app (including terminal emulator) runs in a sandbox and does not have access to anything except /system (read-only access), emulated user-storage and its own data inside /data/data/. So in phone itself, you cannot read the file unless you copy it to /system or user-memory. And this finally implies that except above two methods, there is no other way to copy file to some other place except user-memory and be able to read it using some app inside phone itself without rooting.
Thanks for your comprehensive reply. I resolved the problem. Yes, it's right, I can simply run the shell script without even moving it to /data/local/tmp... so now I can conveniently running it directly from my phone without having to turn a computer on and do it over ADB.
thankx

Categories

Resources