Android file system basics - Android Q&A, Help & Troubleshooting

I have OP6 Pie, rooted using Magisk
I installed Termux,
when i open termux, I get $ prompt to type commands, I am able to use all normal commands of Linux like CD, ls, rm, python, apt update......, there is no issues at all
when I use type SU and granted root access
the command line changed to
:/data/data/com.termux/files/home/storage/shared
now if I type command apt-update, python, python2..., I get error that its not installed.
I mean to say why is it not allowing me to use python in root
One more thing, if I am in root mode and I type exit
I get $ prompt as usual and all commands including python works here

Have no idea about that

Related

Fedora 12 WIP

I can get into console mode and mess about with some fedora commands but thats about it. Anyone feel free to take this further...
http://qole.org/files/fedora12-m5-v1a.img.ext2.lzma
Decompress with BitZipper and rename to fedora.img
http://www.mediafire.com/?9fw3vu463rs3vff fedboot
Place both files in sd card main directory and run in Terminal Emulator:
Code:
su
sh /sdcard/fedboot
After a few seconds [[email protected] root] should appear.
Code:
startx
is not a recognised command
Tried switching from Cli to GUI and changing runlevels using:
If you installed using a text login and wish to switch to a graphical login, follow this procedure.
If you are not already root, switch users to the root account:
su -
Provide the administrator password when prompted.
If you have not already done so, install the X Window System and a graphical desktop environment. For example, to install the GNOME desktop environment, use this command:
yum groupinstall "X Window System" "GNOME Desktop Environment"
To install the KDE desktop environment, use:
yum groupinstall "X Window System" KDE
To install the XFCE desktop environment, use:
yum groupinstall "X Window System" XFCE
This step may take some time as your Fedora system downloads and installs additional software. You may be asked to provide the installation media depending on your original installation source.
Run the following command to edit the /etc/inittab file:
vi /etc/inittab
Press the I key to enter insert mode.
Find the line that includes the text initdefault. Change the numeral 3 to 5.
Type :wq and press the Enter key to save the file and exit the vi text editor.
Reboot
Click to expand...
Click to collapse
But no luck after reboot.
Code:
su -c 'telinit 5'
Gives a communication refused message.
Hox do you make those versions? Where can I found a tutorial for learning how to make my versio of this (just for me).
Thanks

adb shell and terminal emulator

i gotta question. is adb shell and terminal emulator the same thing? and am i right getting into adb shell with the CMD from windows when having my phone via usb connected in debugging mode? and can someone tell me where i can get a list of commands?
thx
X10mini miniCM7 2.0 using XDA Premium App
freebordjunky said:
i gotta question. is adb shell and terminal emulator the same thing? and am i right getting into adb shell with the CMD from windows when having my phone via usb connected in debugging mode? and can someone tell me where i can get a list of commands?
thx
X10mini miniCM7 2.0 using XDA Premium App
Click to expand...
Click to collapse
adb shell and Terminal Emulator are not the same thing. One is an shell environment (adb shell) and the other is a tool to access that environment (Terminal Emulator).
adb shell is native to the phone and allows for Linux shell access. Terminal emulator will allow you to run adb shell ON the phone directly to access that shell environment.
Secondly, yes you are correct, in that you can use the Command Prompt (CMD) to access adb shell. Also, your phone must be in debugging mode as you stated.
To get a list of commands -- you type: adb, while in the androidsdk\tools folder and it'll display the default set of commands available to you.
Though, the most common commands you'll run are as follows:
adb shell -- Gives you shell access, best used with root access
adb remount -- Mounts the phone for r/w (read-write) access; this
needs to be done if you plan to run the next two commands, but only once.
adb push -- Push's/Move's a file to the specified dir, usually system/app
adb pull -- Copies a file from a specified dir, usually system/app
adb shell reboot -- Reboots your phone from the command line
Hope that helps.
thank you very much
X10mini miniCM7 2.0 using XDA Premium App
Sure, no problem.
pseudoremora said:
Sure, no problem.
Click to expand...
Click to collapse
Hi there, Im new to TE and ADB as well.
1) From what it looks like why would you ever use ADB if you didnt need to exchange files with the computer?
TE seems a lot easier to use without having to install the sdk, different exes etc.
2) I've also stumbled upon the ADBD insecure by chainfire, from what I've gathered, this app gives you root access to stock kernels that otherwise wouldn't have given you that. and saves you from typing long command lines.
But what lines is it saving you from typing? Just "su"?
Adb pull or push DOES NOT work with Terminal Emulator as they are not found as commands. What to do to use them with unrooted phone?
pseudoremora said:
adb shell and Terminal Emulator are not the same thing. One is an shell environment (adb shell) and the other is a tool to access that environment (Terminal Emulator).
adb shell is native to the phone and allows for Linux shell access. Terminal emulator will allow you to run adb shell ON the phone directly to access that shell environment.
Secondly, yes you are correct, in that you can use the Command Prompt (CMD) to access adb shell. Also, your phone must be in debugging mode as you stated.
To get a list of commands -- you type: adb, while in the androidsdk\tools folder and it'll display the default set of commands available to you.
Though, the most common commands you'll run are as follows:
adb shell -- Gives you shell access, best used with root access
adb remount -- Mounts the phone for r/w (read-write) access; this
needs to be done if you plan to run the next two commands, but only once.
adb push -- Push's/Move's a file to the specified dir, usually system/app
adb pull -- Copies a file from a specified dir, usually system/app
adb shell reboot -- Reboots your phone from the command line
Hope that helps.
Click to expand...
Click to collapse
I tried the following from powershell, on windows:
Code:
.\adb.exe shell cmd overlay enable com.android.internal.systemui.navbar.gestural
and it worked.
I tried the same from the terminal emulator, and it said
cmd: service not found: overlay
Click to expand...
Click to collapse
Why is it that it works one way, and not the other way? Aren't they interacting with the same shell enviromnent? Is there a permission difference?

[Tutorial] x10mini Linux helpers

Hello
Like some other guys i use linux on my PC. If you want to change your x10mini via shell you can do it but its not very confortable.
I made a few tools so it's easier to use.
Note: This "tricks" are only usefol to you if you are a little advanced with linux and want to "work" with your x10i via shell. I tested it all on a Debian 64bit but think most parts are universal.
1. Putting adb to /etc/bin
First of all you should put the adb-binary in /etc/bin/ so you can access it like every other cmd. You can use the binary in my attached tar or the one from SDK. use "sudo cp adb /system/bin/adb" (if you have a system with sudo, eg debian & ubuntu)
2. adb: error insufficient permissions for device
If you plug in the phone and want to connect via "adb shell" it may says that you don't have permissions for device. There is a workaround:
- Create file /etc/udev/rules.d/51-android.rules
- Put the following in the file:
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="2137", MODE="0666"
- restart udev "sudo service udev restart" (again this is debian&ubuntu-only)
if you still got "insufficient permissions", i made a little shell-script "adb-fix-permissions" attached in tar-file
3. bash-completition for adb
Bash is really annoying whitout completion. That means you can just start to type a word, then press [tab] and bash complets it for you. For example you type "adb ki[tab]" and bash complets it to "adb kill server"
To get this you need "adb_completition" from my attached zip or from here. Put this file in /etc/bash_completion.d/ and you got it.
example command to copy it:
"sudo cp adb_completition /etc/bash_completion.d/adb_completition"
4. Some keys not work in adb shell
This is a known and annoying bug. Eg in nano text editor you cant use the [enter]-key. There is a (little unclean) workaround for it: start a telnet-service on the phone, forward ports via adb and connetc to your phone via telnet. You will need telnetd from the attached tar. And your phone needs to be rooted.
- Remount system writable:
Code:
adb remount
- Put telnetd on your phone
Code:
adb push telnetd /system/bin/telnetd
- Make it executable:
Code:
adb shell chmod +x /system/bin/telnetd
for usage i have a little made a little script (in attached tar) "adb-shell".
Or you can do it manual:
Code:
adb telnetd &
adb forward tcp:9999 tcp:23
telnet localhost 9999
.. to be continued...
if you have one, please share your linux-android-tricks with me
thanks

[Q] ls does not sort

When I start the ADB shell from the Windows command line, and type the command "ls", the list of files I get is not sorted by name. Also, if I enter "ls -r" which should reverse sort, I get the error message "no such file". If I type "busybox ls -l", I get the expected sorted list. Also, other commands like "busybox ls -la" work.
My Phone is a Samsung Captivate i897, rooted from Gingerbread with Corn Kernel v7.06 with Superuser and BusyBox installed.
How can I get the Busybox version of the shell commands to run without having to type "busybox" all the time?
The same problem
How to force sort in ls result ?

[Guide][ARM now supported] Android development/debugging on ChromeOS - ADB & fastboot

[Guide][ARM now supported] Android development/debugging on ChromeOS - ADB & fastboot
What you need to know before we begin:
ChromeOS (Or Chromium OS if you installed it on a non-chromebook) is based on Unix, and you can access a terminal with button combinations. This part of the guide is easy, but if I can get apt-get working, that's where it gets really complex.
What you'll need
A computer running ChromeOS/Chromium OS
An internet connection on it, or the files on a USB drive (and you to copy them to Downloads)
A little Linux knowledge
Some patience
1.) Download the correct files for system:
ChromeOS/ChromiumOS on an x86 based PC
ChromeOS on an ARM based PC
2.) When the zip has downloaded, extract it so both the adb and fastboot files are in the Downloads folder
3.) It's now time to access the terminal mode. It might be a good idea to get this guide on a phone or some other device so you don't have to switch out at any time.
If you're using a chromebook or an official chromeOS build, you need to access developer mode. Note: this will wipe all your data for security reasons. Full info is here: Chromium Project: Developer mode
4.) Press Ctrl-Alt-F2 on your keyboard, and the whole screen will be a terminal. Read the info at the top, and then login
NOTE: If you're using Chromium OS vanilla builds, the username and password are as follows:
Code:
User: chronos
Pass: facepunch
5.) You now have a localhost terminal, with no root permissions.
6.) Run this code, to locate the location of your Downloads folder:
Code:
ls /home
7.) Mount the filesystem as follows:
Code:
mount -o remount,rw /
8.) Using the name other than "root" and "user", run these commands:
Code:
cp /home/<name>/user/Downloads/adb /sbin/adb
For example, the Chromium one would be:
Code:
cp /home/chronos/user/Downloads/adb /sbin/adb
Repeat for Fastboot (replace "adb" with "fastboot" without the quotes)
9.) Test that it has worked by running:
Code:
adb
It should result in adb working
10.) You're done, adb and fastboot should work. You might need to reboot in some cases for it to work fully
11.) For more stuff, like Java and ant, wait a while until I work out how to get apt-get installed from dpkg
Credits:
Thanks to KMyers for compiling Fastboot for ARM devices, thread here
Reserved
And again
Once more, just in case
Whenever I go to check my path I get this response:
"cat: /usr/local/bin:/usr/bin:/bin:/opt/bin:/home/chronos/user/Downloads/android-sdk-linux/platform-tools: no such file or directory"
Help?
awacker89 said:
Whenever I go to check my path I get this response:
"cat: /usr/local/bin:/usr/bin:/bin:/opt/bin:/home/chronos/user/Downloads/android-sdk-linux/platform-tools: no such file or directory"
Help?
Click to expand...
Click to collapse
That is perfectly normal, every Linux based thing says no file or directory after the path to my knowledge
Sent from my GALAXY NEXUS using Tapatalk 4 (VIP)
Quinny899 said:
That is perfectly normal, every Linux based thing says no file or directory after the path to my knowledge
Sent from my GALAXY NEXUS using Tapatalk 4 (VIP)
Click to expand...
Click to collapse
And so it seems! Now it appears that any adb command returns a "Permission denied" message. Ideas?
Update: Same response for fastboot commands.
awacker89 said:
And so it seems! Now it appears that any adb command returns a "Permission denied" message. Ideas?
Update: Same response for fastboot commands.
Click to expand...
Click to collapse
Try this:
Code:
cd /home/chronos/user/Downloads/android-sdk-linux/platform-tools
chmod 755 adb
chmod 755 fastboot
Then exit back to the login screen on the terminal, login again and try running adb
Quinny899 said:
Try this:
Code:
cd /home/chronos/user/Downloads/android-sdk-linux/platform-tools
chmod 755 adb
chmod 755 fastboot
Then exit back to the login screen on the terminal, login again and try running adb
Click to expand...
Click to collapse
Still no dice
I'm starting to lose hope. I just keep getting "permission denied."
I thought maybe trying this would do the trick but still no response.
Code:
sudo ./adb devices
[code]
P.S. Guess I should mention that running just adb returns command not found, so I've been using ./adb. Maybe I just don't know what the hell I'm doing but I just can't get it to work.
Hmmm. Well, The SDKx86 (87mb) that were in the instructions so, I downloaded the ADT (399mb) instead, just a hint.
Is there a specific branch that is required to be on in chromeos in order for terminal to act correctly? I never get any chance to login once i get into the "crosh" terminal.
Quinny899 said:
That is perfectly normal, every Linux based thing says no file or directory after the path to my knowledge
Sent from my GALAXY NEXUS using Tapatalk 4 (VIP)
Click to expand...
Click to collapse
Instead of doing
Code:
cat $PATH
you should do
Code:
echo $PATH
The cat command is trying to concatenate a file with the name of your full path, which obviously doesn't exist. echo tells you the value of the $PATH variable, which is what you're actually trying to do.
I was trying to get this to work on my Chromebook Samsung Series 5 550
Furst thing I noticed was the absence of an f2 key - tried a usb keyboard no joy
I assume what I am trying to launch is Shell which can only be accessed with a Chrome OS device in developer mode. I really want to get this working so I will try activating developer mode and report back.
Update:
So Developer Mode resets and wipes your device (doh!) back to Step 1
Update 2: (Dev Mode activated function key labelled as "->" works as f2 and launches shell successfully"
Has anyone got this working? I noticed that the folder coming out of the SDK zip is called "sdk" but all the commands listed in the guide use "android-sdk-linux"
I used "sdk" and just get the Permission Denied issue even after chmod on adb
Will this work on the Samsung Series 3 with the ARM processor?
imtoomuch said:
Will this work on the Samsung Series 3 with the ARM processor?
Click to expand...
Click to collapse
Supposedly pulling the adb binary from an android device (/system/bin/adb) and using that would work. Don't know about fastboot though
Sent from my Galaxy Nexus using Tapatalk 4 Beta
jambamkin said:
I was trying to get this to work on my Chromebook Samsung Series 5 550
Furst thing I noticed was the absence of an f2 key - tried a usb keyboard no joy
I assume what I am trying to launch is Shell which can only be accessed with a Chrome OS device in developer mode. I really want to get this working so I will try activating developer mode and report back.
Update:
So Developer Mode resets and wipes your device (doh!) back to Step 1
Update 2: (Dev Mode activated function key labelled as "->" works as f2 and launches shell successfully"
Has anyone got this working? I noticed that the folder coming out of the SDK zip is called "sdk" but all the commands listed in the guide use "android-sdk-linux"
I used "sdk" and just get the Permission Denied issue even after chmod on adb
Click to expand...
Click to collapse
I had the same problems. And just stopped trying about 2 days of trying to figure it out.
I was able to find a version of adb compiled for ARM but it was from an older version which made it a no go on my Nexus 4 (4.2.2 requires updated adb to work with the new security enhancements built in).
I tried it on my Series 5 550 chromebook. Can't seem to get it to work.
I do all the commands and it shows up in echo $PATH but then when i try adb anything it says permission denied. I do the chmod 755 and still permission denied.
i tried to exit back to the login and then the folder wasn't in the echo path anymore. adb not working either. I tried rebooting chromebook and it wasnt there either.
Would it be cheating to get it running with crouton? Because I did get that done.
Sent from my NookColor using xda premium
yeah i've been having the same issue with my samsung 5 series chromebook. "permission denied" and all that. But on the fun side, i learned if you want to really make your chromebook bug-out; type cat adb whilst in /platform-tools.

Categories

Resources