Connected to my android device using ADB but not able to use ls command, it says permission denied - General Topics

I connected to my android device (stock android, 10) using ADB on ubuntu, now when I go to /data/ and do ls, it says permission denied.
Why? How to solve this problem?

Did you root your phone and did you run "adb root"?
Reference: https://stackoverflow.com/a/1043722/2908623

Related

Changing permissions without ADB

I have a phone that came pre-installed with su, busybox and superuser; but the permissions are not set correctly for the user to access su and get root. The phone is running Android 1.6 and when you connect it to a computer in debug mode it is not recognized as an Android device; even though the phone says it is plugged into a computer and in debug mode. The only thing that comes up is the drive to access the SD card. My question is thus: Is there any way to change the permissions of su on the device itself? I have tried running a terminal emulator but when I type "su" the result is permission denied. Since I don't have permissions I cannot do a chmod on the device itself. If anyone knows a method I can do this I would appreciate it very much.

Samsung SM?T230NU 5.0- ADB Shows Unauthorized Device

adb shows Unauthorized device on custom ROM for SM-231
I successfully rooted my SM-230NU and installed the custom ROM provided in this post
http://forum.xda-developers.com/tab-4/development/rom-android-5-0-lollipop-material-t3061873
However, when I connect the device using USB to my Mac and try "adb devices" I get "unauthorized" beside the device ID. I have already tried the following:
a. on the Mac: adb kill-server followed by adb start-server
b. on the Mac: Deleted the ~/.android/adbkey and ~/.android/adbkey.pub
c. on Device: Revoked the USB debugging access to all computers (on the device) and also via terminal emulator app verified that on the device /data/misc/adb/ directory is empty
d. on PC: Repeated all the above on a Windows 7 machine (still shows "unauthorized" beside the device ID)
e. Changed multiple cables and tried the same cable with other devices and they are all detected as valid devices.
Unless I get the device to be recognized I am not able to install some apks using adb install. Any help will be highly appreciated.

Android 4.1.1 - Files executed with an ADB connection

Hi.
I'm trying to control the access to ADB on Android 4.1.1. I already have root access to the device and now I'm trying to execute some access control code at the start of an ADB connection.
Are there any scripts that are executed with the "adb shell" access?
Thank you!

Is it possible to do adb operations from android phone itself, without a computer?

I have seen discussions online such as this:
https://stackoverflow.com/questions/12634280/what-is-a-adb-daemon
If I understand the answers give there correctly, whenever I use an adb command on my computer connected to a smartphone, the reason it does anything is because there is a background process adbd, the adb daemon, running on the smartphone. Everything I see on the computer screen when I issue an adb command is the result returned by the adbd daemon.
a) Is this correct? Is this how adb is supposed to work?
b) If it is correct, is there any way to programmatically enable/disable/re-enable the adbd process? Can I programmatically interact with adbd at all (either through Java or NDK)? Can I use adbd from the android phone itself and perform actions performed using adb, without using a computer?
I am hoping to do this on a non rooted device, but if not, any kind of device will do.
mahaju said:
I have seen discussions online such as this:
https://stackoverflow.com/questions/12634280/what-is-a-adb-daemon
If I understand the answers give there correctly, whenever I use an adb command on my computer connected to a smartphone, the reason it does anything is because there is a background process adbd, the adb daemon, running on the smartphone. Everything I see on the computer screen when I issue an adb command is the result returned by the adbd daemon.
a) Is this correct? Is this how adb is supposed to work?
b) If it is correct, is there any way to programmatically enable/disable/re-enable the adbd process? Can I programmatically interact with adbd at all (either through Java or NDK)? Can I use adbd from the android phone itself and perform actions performed using adb, without using a computer?
I am hoping to do this on a non rooted device, but if not, any kind of device will do.
Click to expand...
Click to collapse
Yes, but it requires having a rooted device and the terminal emulator app. Or you can install TWRP and use the terminal emulator that is built into TWRP.
Sent from my SM-S767VL using Tapatalk
reply to answer
Droidriven said:
Yes, but it requires having a rooted device and the terminal emulator app. Or you can install TWRP and use the terminal emulator that is built into TWRP.
Sent from my SM-S767VL using Tapatalk
Click to expand...
Click to collapse
I have an old rooted samsung phone with android 4.2.2
Is there any sample code on how I can interact with the adbd daemon? In the terminal emulator if I type "adb shell" it says starting daemon but then it says device not found. how would I do some basic stuff (like take a screen shot using "adb shell screencap" for example? Can I interact with it programmatically from java or ndk?
mahaju said:
I have an old rooted samsung phone with android 4.2.2
Is there any sample code on how I can interact with the adbd daemon? In the terminal emulator if I type "adb shell" it says starting daemon but then it says device not found. how would I do some basic stuff (like take a screen shot using "adb shell screencap" for example? Can I interact with it programmatically from java or ndk?
Click to expand...
Click to collapse
When using terminal emulator, it uses the same commands as adb shell(not the standard adb), but you remove "adb shell" from the commands. For example, in terminal emulator, it is:
reboot recovery
Instead of:
adb reboot recovery
Or
adb shell reboot recovery
Also, before running your commands in terminal emulator, you need to use the su command by typing:
su (then press enter, grant the app superuser/root permissions)
Then you can run the rest of your commands.
Sent from my SM-S767VL using Tapatalk

Connected to my android device using ADB but not able to use ls command, it says permission denied

I connected to my android device (stock android, 10) using ADB on ubuntu, now when I go to /data/ and do ls, it says permission denied.
Why? How to solve this problem?
Android must be rooted to access the /data partition via ADB, that's all

Categories

Resources