raju
raju

Reputation: 785

how to grant adb shell permission without rooting devices

I am running following commands from command prompt while running it shows permission denied. can any one please explain how to grant permission?

C:\android\tools>adb push asl-native /data/local/asl-native
failed to copy 'asl-native' to '/data/local/asl-native': Permission denied

Upvotes: 7

Views: 33947

Answers (3)

Huyen
Huyen

Reputation: 21

Follow the comment of [ankita] (https://code.google.com/p/android-screenshot-library/wiki/UserGuide): "It can work for non rooted device also.just change all path /data/local to /data/local/tmp in run.bat file then save and run it." I tried and the problem were solved

Upvotes: 1

drt
drt

Reputation: 723

You're not allowed to write to /data unless your phone is rooted and able to run adb shell as root.

Looking at asl's run script you might be able to change it to install it to the scard. I haven't tested it but it would look something like this:

# Install service
echo "Installing native service..."
$adb push ./asl-native /sdcard/asl-native
$adb shell /system/bin/chmod 0777 /sdcard/asl-native

# Start the service
echo "Starting service..."
$adb shell "/sdcard/asl-native /sdcard/asl-native.log" &
echo "Service started successfully."

Although I dunno if you're allowed to run chmod and make something executable. You might want to try running chmod 0777 on your local machine first.

Upvotes: 2

Alex P.
Alex P.

Reputation: 31676

Find a partition on your phone which is both writable (for the shell user) and does not have the noexec option and push your executable to that partition.

Upvotes: 0

Related Questions