Whatever I type after adb shell
it fails with Permission denied
:
D:android-sdk-windowsplatform-tools>adb shell find /data -name *.db
find: permission denied
D:android-sdk-windowsplatform-tools>adb shell test
test: permission denied
D:android-sdk-windowsplatform-tools>adb remount
remount failed: No such file or directory
Any ideas?
Yves M.
29.3k22 gold badges107 silver badges142 bronze badges
asked Sep 13, 2011 at 8:41
5
According to adb help
:
adb root - restarts the adbd daemon with root permissions
Which indeed resolved the issue for me.
answered Jun 5, 2012 at 14:07
RomanRoman
1,7651 gold badge12 silver badges12 bronze badges
2
Without rooting: If you can’t root your phone, use the run-as <package>
command to be able to access data of your application.
Example:
$ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/
exec-out
executes the command without starting a shell and mangling the output.
answered Jul 10, 2016 at 13:33
Fabian ZeindlFabian Zeindl
5,7728 gold badges52 silver badges77 bronze badges
3
The reason for «permission denied» is because your Android machine has not been correctly rooted. Did you see $
after you started adb shell
? If you correctly rooted your machine, you would have seen #
instead.
If you see the $
, try entering Super User mode by typing su
. If Root is enabled, you will see the #
— without asking for password.
answered Aug 15, 2012 at 9:46
windwind
2552 silver badges2 bronze badges
5
You might need to activate adb root from the developer settings menu.
If you run adb root
from the cmd line you can get:
root access is disabled by system setting - enable in settings -> development options
Once you activate the root option (ADB only or Apps and ADB) adb will restart and you will be able to use root from the cmd line.
answered Mar 4, 2013 at 12:20
MacarseMacarse
91.2k44 gold badges173 silver badges230 bronze badges
5
None of the previous solutions worked for me but I was able to make it work using this command
adb shell "run-as com.yourcompany.app cat /data/data/com.yourcompany.app/shared_prefs/SHARED_PREF_PROTECTED.xml" > SHARED_PREF_PROTECTED.xml
answered Apr 21, 2021 at 12:39
1
The data
partition is not accessible for non-root users, if you want to access it you must root your phone.
ADB root
does not work for all product and depend on phone build type.
in the new version of android studio, you can explore /data/data
path for debuggable apps.
update 2022
Android Studio new versions have some tools like Device Explorer
and App Inspection
to access application data. (app must be debuggable).
answered Dec 19, 2018 at 4:30
GolilGolil
4223 silver badges11 bronze badges
2
if you are looking to get /data/anr/ as I was, you can use an easy approach
adb bugreport
source: this answer
answered Oct 24, 2022 at 21:53
Do adb remount. And then try adb shell
answered Sep 13, 2011 at 8:50
2
Run your cmd
as administrator this will solve my issues.
Thanks.
answered Nov 6, 2017 at 7:43
Kishan OzaKishan Oza
1,6911 gold badge14 silver badges38 bronze badges
1
TL;DR;
com.package.name
is your app identifier, and the file path is relative to the app user’s home directory, e.g. '/data/user/0/com.package.name
.
adb shell run-as com.package.name cp relative/path/file.ext /sdcard adb pull /sdcard/file.ext
See long explanation below.
Problem
Trying to adb pull
files from our app’s directory fails with Permission denied
,
because the adb user doesn’t have access to the home directory.
adb pull /data/user/0/com.package.name/file.ext
Error:
adb: error: failed to stat remote object '/data/user/0/com.package.name/file.ext': Permission denied
You can try to run adb
as root first:
But on a non-rooted device, this fails with:
adbd cannot run as root in production builds`
Here’s a workaround on how to download a file from the app data directory using run-as
.
Long version
This explains the solution step by step.
Start a shell session on the device. All following commands will be executed in the shell session on your device.
Assuming our app identifier is com.package.name
, the app data directory is at /data/user/0/com.package.name
.
You can try to list files in that directory:
ls /data/user/0/com.package.name
This should result in error:
ls: /data/user/0/com.package.name/: Permission denied
However, you can run a command using the com.package.name
application identity with the run-as
command
run-as com.package.name ls /data/user/0/com.package.name/
You should now see a directory listing, and you can find the file you want,
and copy it to a directory on your device that doesn’t require root access, e.g. /sdcard
:
run-as com.package.name cp /data/user/0/com.package.name/file.ext /sdcard
We can then exit the adb shell:
Back at our own computer, we can adb pull
the file:
adb pull /sdcard/file.ext
On a recent attempt to pull a realm database file created by an application that I built on my device, I got an error with the following message:
$ adb pull /data/data/com.example.test/files/default.realm .
adb: error: failed to stat remote object '/data/data/com.example.test/files/default.realm': Permission denied
Let’s see how we can solve this!
TLDR
Long story short, you can run the following command from the Terminal
to create a copy of the file in your machine’s file system:
adb shell "run-as om.example.test cat /data/data/com.example.test/files/default.realm" > default.realm
This only works for Debug builds and not for a production app.
But let’s break it down to pieces!
Explanation
You can use adb shell
to connect to the device’s shell. Then, if you want to access the data of an app with an applicationId
set to com.example.test
, you will have to run the command run-as com.example.test
inside the adb shell.
Once you execute this command, the working directory will change to the /data/data/com.example.test
. From there, you can use commands like ls
to get a list of the available directories and cat
to get the content of a specific file.
The last step (> default.realm
) is to redirect the content of the file to a file on my machine’s file system.
And that’s it! Now you will be able to copy the file from a device for an application that you have built without any error!
9 ответов
Согласно adb help
:
adb root - restarts the adbd daemon with root permissions
Что действительно разрешило проблему для меня.
Roman
05 июнь 2012, в 14:24
Поделиться
Без rooting. Если вы не можете подключить свой телефон, используйте команду run-as <package>
для доступа к данным вашего приложения.
Пример:
$ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/
exec-out
выполняет команду без запуска оболочки и обработки вывода.
Fabian Zeindl
10 июль 2016, в 15:25
Поделиться
Причина отказа в доступе объясняется тем, что ваша машина Android не была правильно внедрена. Вы видели $
после запуска adb shell
? Если вы правильно укоренили свою машину, вы бы увидели #
.
Если вы видите $
, попробуйте ввести режим суперпользователя, набрав su
. Если Root включен, вы увидите #
— без запроса пароля.
wind
15 авг. 2012, в 11:31
Поделиться
Возможно, вам потребуется активировать adb root из меню настроек разработчика.
Если вы запустите adb root
из строки cmd, вы можете получить:
root access is disabled by system setting - enable in settings -> development options
После активации опции root (только ADB или Apps и ADB) adb перезапустится, и вы сможете использовать root из строки cmd.
Macarse
04 март 2013, в 13:14
Поделиться
Раздел data
недоступен для пользователя, не являющегося пользователем root, если вы хотите получить к нему доступ, вы должны получить root права на свой телефон.
adb root
не работает для всех продуктов и зависит от типа сборки телефона.
В новой версии на Android Studio вы можете исследовать /data/data
path для отлаживаемых приложений.
Golil
19 дек. 2018, в 05:36
Поделиться
Будьте осторожны с косой чертой, измените «» на «/», например:
adb.exe нажмите SuperSU-v2.79-20161205182033.apk/storage
cepix
26 дек. 2017, в 04:43
Поделиться
Запустите свой cmd
как администратор, это решит мои проблемы.
Благодарю.
Kishan Oza
06 нояб. 2017, в 09:01
Поделиться
Сделайте adb remount. И затем попробуйте adb shell
Pavankumar Vijapur
13 сен. 2011, в 10:01
Поделиться
Ещё вопросы
- 1OPENCV Как заполнить недостающий прямоугольник?
- 1Строка Заменить «\» на «»
- 1Пройдите маршрут к действию контроллера
- 1Понимание рекурсивного асинхронного вызова в JavaScript
- 0Предельные символы отображаются в HTML
- 0Изменение Sendmail на Pear Mail
- 2Ссылка npm не работает с созданными angular-cli проектами
- 0PHP inc / dec порядок суммы 2 чисел
- 0В AWS PHP S3 SDK нет функции moveObject
- 1Проблемы с обновлением с JavaFX 2.2 до JavaFX 8 (возможная ошибка?) [Duplicate]
- 1Как получить элемент ListView с помощью Android onItemClick?
- 1Python / GPyOpt: оптимизация только одного аргумента
- 1Используя карту с queue.put ()?
- 1Разделить файл web.config
- 1Ява печатать две строки вместе
- 0Поиск записей условий с помощью модели hasMany Cakephp3
- 1Устранение неполадок java.lang.NullPointerException в учебном упражнении с Android SDK
- 0MYSQL Пользовательская переменная проблема
- 0JS Установка атрибута onclick разными способами
- 0блокировка матрицы дает ошибку сегментации
- 0JQuery — Fade Out DIV из нескольких выпадающих
- 1Возьмите значение всех ненулевых текстовых полей в форме и поместите его в массив. C # Winforms
- 0RSA… GNU MP: невозможно выделить память (размер = 1307836444)
- 0Проверьте отсортированные строки c ++ с помощью ‘uniq’
- 0jQuery Выберите радио по значению?
- 0Это всегда дает неопределенную ошибку ссылки
- 0Расширенный поиск с помощью флажка в PHP
- 0Материал Angular с NavBar не реагирует на браузер iPhone
- 0фокус: всегда выше классов
- 1Javascript дает неправильные числовые ответы во время проверки данных
- 0использование значения в поле выбора в качестве входа для сохранения в таблицу sql
- 0Получить все записи из одной таблицы плюс относительную последнюю запись второй таблицы
- 0Обработка кодирования / декодирования B64 в случае, если данные не кратны 3
- 0Запретить прямой URL вместо перенаправления на виртуальный хост
- 0.hasOwnProperty … и значение?
- 0Небольшая проблема со скользящим DIV-кодом Javascript
- 1C # Access, Как выполнить запрос из представления в доступе
- 0поместите div поверх видео <object> в HTML CSS
- 0Убедитесь, что длинная строка загружена в справочную базу
- 0Создание страницы регистрации с Heroku — ошибки NotFoundException
- 1Какой самый быстрый способ заменить текст многих элементов управления контентом через office-js?
- 1Получить количество дублированных значений на категорию / группу в Python Python
- 1<form> отключил мой код JavaScript
- 1Угловые ngx-datatable несколько данных в одном столбце
- 0Несколько параметров HTTP GET в массив
- 0Есть ли способ получить массив индексируется по именам таблиц в PHP MySQL PDO
- 0Разбивка на несколько классов div
- 0Очистка данных сеанса из БД по окончании сеанса
- 1Vue Webpack Build Breaks Bulma CSS
- 1Смещение часового пояса D3 смещается на предыдущий день
Содержание
- Android permission doesn’t work even if I have declared it
- 11 Answers 11
- Android can’t open file, FileNotFoundException(Permission denied), but PermissionRead is granted [duplicate]
- 3 Answers 3
- Conclusion: Solution
- Why: Reasons to fix
- Android: adb: Permission Denied
- 10 Answers 10
- update 2022
- Android Studio error 13=permission denied in linux
- 14 Answers 14
- SecurityException: Permission denied (missing INTERNET permission?)
- 13 Answers 13
Android permission doesn’t work even if I have declared it
I’m trying to write code to send an SMS from an Android app, but when I try to send the SMS it sends me back the error:
I checked but I have the permissions in the manifest, as follows:
I searched the internet but all the errors were about the syntax, could you help me please?
11 Answers 11
The big reason for not getting your permission nowadays is because your project has a targetSdkVersion of 23 or higher, and the permission that you are requesting is «dangerous». In Android 6.0, this includes:
- ACCEPT_HANDOVER
- ACCESS_BACKGROUND_LOCATION
- ACCESS_MEDIA_LOCATION
- ACTIVITY_RECOGNITION
- ANSWER_PHONE_CALLS
- ACCESS_COARSE_LOCATION
- ACCESS_FINE_LOCATION
- ADD_VOICEMAIL
- BODY_SENSORS
- CALL_PHONE
- CAMERA
- GET_ACCOUNTS
- PROCESS_OUTGOING_CALLS
- READ_CALENDAR
- READ_CALL_LOG
- READ_CELL_BROADCASTS
- READ_CONTACTS
- READ_EXTERNAL_STORAGE
- READ_PHONE_STATE
- READ_SMS
- RECEIVE_MMS
- RECEIVE_SMS
- RECEIVE_WAP_PUSH
- RECORD_AUDIO
- SEND_SMS
- USE_SIP
- WRITE_CALENDAR
- WRITE_CALL_LOG
- WRITE_CONTACTS
- WRITE_EXTERNAL_STORAGE
For these permissions, not only does your targetSdkVersion 23+ app need to have the element(s), but you also have to ask for those permissions at runtime from the user on Android 6.0+ devices, using methods like checkSelfPermission() and requestPermissions() .
As a temporary workaround, drop your targetSdkVersion below 23.
However, eventually, you will have some reason to want your targetSdkVersion to be 23 or higher. At that time, you will need to adjust your app to use the new runtime permission system. The Android documentation has a page dedicated to this topic.
Источник
Android can’t open file, FileNotFoundException(Permission denied), but PermissionRead is granted [duplicate]
Android can’t open file with FileNotFoundException(Permission denied), but PermissionRead is granted.
java.io.FileNotFoundException: /mnt/obb/»file detailed path»: open failed: EACCES (Permission denied)
obb file is ERROR_ALREADY_MOUNTED.
PermissionRead is granted.
Android OS ver.6.0 device.
3 Answers 3
Try to give runtime permission
have you implemented runtime permission?, first you grant manually storage permission from settings and check exception occur or not, if not then you have mistake in permission implementation.
Thank you for answers.
This is a very strange phenomenon. Once, I was able to fix it to work properly.
Conclusion: Solution
Create an obb file with jobb command with the same name as renamed on Google Play side.
That is. Before the fix was done like this.(example)
And if you upload «main1.obb» to Google Play, «main.1.com.test.testapp.obb» will be downloaded along with apk download.
But this is not good.
After the correction, it was programmed like this.
Why: Reasons to fix
I thought that there was a problem with obb mount when the following error occurred:
So I tried to unmount obb after the error. Then an error came back.
If I try to unmount an already mounted obb, it is a permission error. This is strange.
As I looked it up on the Internet, the problem is obb filename made with the jobb command? Or package name? It was said that it occurred.
Therefore, I changed the obb file name generated by the jobb command. There is no problem with this. Of course, «READ_EXTERNAL_STORAGE» has always acquired.
I did not understand anything more. Just the application is working correctly.
Источник
Android: adb: Permission Denied
Whatever I type after adb shell it fails with Permission denied :
10 Answers 10
According to adb help :
Which indeed resolved the issue for me.
Without rooting: If you can’t root your phone, use the run-as
command to be able to access data of your application.
$ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/
exec-out executes the command without starting a shell and mangling the output.
The reason for «permission denied» is because your Android machine has not been correctly rooted. Did you see $ after you started adb shell ? If you correctly rooted your machine, you would have seen # instead.
If you see the $ , try entering Super User mode by typing su . If Root is enabled, you will see the # — without asking for password.
You might need to activate adb root from the developer settings menu. If you run adb root from the cmd line you can get:
Once you activate the root option (ADB only or Apps and ADB) adb will restart and you will be able to use root from the cmd line.
None of the previous solutions worked for me but I was able to make it work using this command
The data partition is not accessible for non-root users, if you want to access it you must root your phone.
ADB root does not work for all product and depend on phone build type.
in the new version of android studio, you can explore /data/data path for debuggable apps.
update 2022
Android Studio new versions have some tools like Device Explorer and App Inspection to access application data. (app must be debuggable).
Источник
Android Studio error 13=permission denied in linux
i am using android studio latest version in linux(elementary luna to be specific). I installed jdk, android studio and sdk successfully, android studio opens us perfectly and even i can work on my app. but when i bulid app it gives error 13: permission denied and it opens a black circle image png in new tab.
i dont understand the problem. i did searched on internet and tried many methods like
changing permissions with chmod:
chmod +x /home/alex/android-studio/sdk/build-tools/android-4.2.2/dx
it executes successfully but with no effect on the problem itself,
2.closing and re-importing project,
3.i also tried this,
and i get following result
i guess this is not issue since my system is 32 bit and this is for 64 bit systems.
Can anyone help? since i am really counting on it.
my system configurations:(if useful)
-OS Version: 0.2.1 «Luna» ( 32-bit ), Built on: Ubuntu 12.04 ( «Precise» )
-installed OpenJdk 7: java version «1.6.0_34» OpenJDK Runtime Environment (IcedTea6 1.13.6) (6b34-1.13.6-1ubuntu0.12.04.1)
OpenJDK Client VM (build 23.25-b01, mixed mode, sharing)
14 Answers 14
I’m running android studio 1.0.2 on ubuntu 14.04 (LTS) 32 bit and i had the same problem. just go to «/home/suUs12/Android/Sdk/build-tools/21.1.2/» and then right click on ‘aapt‘ file , properties -> permissions and check ‘Allow executing file as program‘. then close the window.
In my case,after giving permission for ‘aapt‘ file, I had to give the same permission for ‘dx‘ and ‘zipalign‘ files in the same directory (/home/suUs12/Android/Sdk/build-tools/21.1.2/) and I was able to run my first app using android studio.
Give Root permission to your android studio by using
chmod -777 YourAndroidStudioFolder
This problem is about insufficient authority. If you change your user as ‘root’ and you open android studio, this problem will be resolved. For ex;
[enter your password] : ********
$ cd /home/username/. /android-studio/bin
If this can help, I solved after giving full execution permissions ( chmod a+x ) to all executables in /opt/android-bundle/sdk/build-tools/$VERSION/ ( aapt , dx and zipalign ).
The permissions problem with file not found with aapt wasn’t with this file itself but with the *.so files it tries to use. The first thing to do which I didn’t at first was run the following sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686 to get the necessary 32 bit *.so files installed. I found out about the missing *.so files by running aapt outside the studio. I also found there were a number of files that were read or read write only that needed to be executable in these directories. android-studio/bin android-studio/jre/bin android-studio/jre/jre/bin android-studio/gradle/gradle-2.14.1/bin
The fsnotifier files and the 2 *.sh file in the first bin directory. All the files in the two jre directories and the gradle file in the last directory needed to be chmod 755. After I did that I no longer get the pop up box about the fsnotifier and the gradle build doesn’t get the permission error. Running as root doesn’t help when the problem is with files not being executable.
I Solved This Problem By : Right Click On Main Folder Like Android-Studio and then Go to Properties and then Click On Permission and check CheckBox For Allow Executing File As a Program Then Run Android Studio In Terminal 🙂
Remove the build tool and re download it fixes my problem.
just reinstall the build tool version and then go into folder where sdk is installed and in build tool version’s «aapt» file and change permissions from «property» all to read and write and check mark to «Allow executing file as a program» and then close it. same problem is solved by doing this.
You can reinstall androidstudio in /opt/ folder.This is a shared folder.I refer to official web’s vedio on how to install androidstudio and solve the problem.I almost tried every way on the internet,but it didn’t work.In fact,this is just a question about permission.
In my case the partition in which I saved the Sdk was mounted with the defaults option in /etc/fstab, which in turn enabled the default noexec option which forbids execution for all files in that partition.
Then I edited that line in fstab appending exec, resulting in the options list ‘user,defaults,exec’ for that partition.
Источник
SecurityException: Permission denied (missing INTERNET permission?)
this error is really really really strange and I don’t know how to reproduce it and how to fix it because I made a lot of searches but nothing was useful.
Here’s the stacktrace:
Here’s my AndroidManifest.xml
Please don’t bother asking me if I have the correct INTERNET permission in my manifest because this app is in market since 2 years 😛
I’ve also noticed that (from Crittercism) all bugs are coming from Android 4.1.x version (JB). I don’t know if device are rooted or what (I can’t see this information for the moment)
13 Answers 13
NOTE: I wrote this answer in Jun 2013, so it’s bit dated nowadays. Many things changed in Android platform since version 6 (Marshmallow, released late 2015), making the whole problem more/less obsolete. However I believe this post can still be worth reading as general problem analysis approach example.
Exception you are getting ( SecurityException: Permission denied (missing INTERNET permission?) ), clearly indicates that you are not allowed to do networking. That’s pretty indisputable fact. But how can this happen? Usually it’s either due to missing entry in your AndroidManifest.xml file or, as internet permission is granted at installation not at run time, by long standing, missed bug in Android framework that causes your app to be successfully installed, but without expected permission grant.
My Manifest is correct, so how can this happen?
Theoretically, presence of uses-permission in Manifest perfectly fulfills the requirement and from developer standpoint is all that’s needed to be done to be able to do networking. Moreover, since permissions are shown to the user during installation, the fact your app ended installed on user’s device means s/he granted what you asked for (otherwise installation is cancelled), so assumption that if your code is executed then all requested permissions are granted is valid. And once granted, user cannot revoke the permission other way than uninstalling the app completely as standard Android framework (from AOSP) offers no such feature at the moment.
But things are getting more tricky if you also do not mind your app running on rooted devices too. There’re tools available in Google Play your users can install to control permission granted to installed apps at run-time — for example: Permissions Denied and others. This can also be done with CyanogenMod, vendor brand (i.e. LG’s) or other custom ROM, featuring various type of «privacy managers» or similar tools.
So if app is blocked either way, it’s basically blocked intentionally by the user and if so, it is really more user problem in this case (or s/he do not understand what certain options/tools really do and what would be the consequences) than yours, because standard SDK (and most apps are written with that SDK in mind) simply does not behave that way. So I strongly doubt this problem occurs on «standard», non-rooted device with stock (or vendor like Samsung, HTC, Sony etc) ROM.
I do not want to crash.
Properly implemented permission management and/org blocking must deal with the fact that most apps may not be ready for the situation where access to certain features is both granted and not accessible at the same time, as this is kind of contradiction where app uses manifest to request access at install time. Access control done right should must make all things work as before, and still limit usability using techniques in scope of expected behavior of the feature. For example, when certain permission is granted (i.e. GPS, Internet access) such feature can be made available from the app/user perspective (i.e. you can turn GPS on. or try to connect), the altered implementation can provide no real data — i.e. GPS can always return no coordinates, like when you are indoor or have no satellite «fix». Internet access can be granted as before, but you can make no successful connection as there’s no data coverage or routing. Such scenarios should be expected in normal usage as well, therefore it should be handled by the apps already. As this simply can happen during normal every day usage, any crash in such situation should be most likely be related to application bugs.
We lack too much information about the environment on which this problem occurs to diagnose problem w/o guessing, but as kind of solution, you may consider using setDefaultUncaughtExceptionHandler() to catch such unexpected exceptions in future and i.e. simply show user detailed information what permission your app needs instead of just crashing. Please note that using this will most likely conflict with tools like Crittercism, ACRA and others, so be careful if you use any of these.
Notes
Please be aware that android.permission.INTERNET is not the only networking related permission you may need to declare in manifest in attempt to successfully do networking. Having INTERNET permission granted simply allows applications to open network sockets (which is basically fundamental requirement to do any network data transfer). But in case your network stack/library would like to get information about networks as well, then you will also need android.permission.ACCESS_NETWORK_STATE in your Manifest (which is i.e. required by HttpUrlConnection client (see tutorial).
Addendum (2015-07-16)
Please note that Android 6 (aka Marshmallow) introduced completely new permission management mechanism called Runtime Permissions. It gives user more control on what permission are granted (also allows selective grant) or lets one revoke already granted permissions w/o need to app removal:
This [. ] introduces a new permissions model, where users can now directly manage app permissions at runtime. This model gives users improved visibility and control over permissions, while streamlining the installation and auto-update processes for app developers. Users can grant or revoke permissions individually for installed apps.
However, the changes do not affect INTERNET or ACCESS_NETWORK_STATE permissions, which are considered «Normal» permissions. The user does not need to explicitly grant these permission.
See behavior changes description page for details and make sure your app will behave correctly on newer systems too. It’s is especially important when your project set targetSdk to at least 23 as then you must support new permissions model (detailed documentation). If you are not ready, ensure you keep targetSdk to at most 22 as this ensures even new Android will use old permission system when your app is installed.
Источник
-
Thread Starter
First, I’m not rooted. I don’t need root to push files using ADB though. I’m trying to push a file to «system/app» using ADB but I keep getting «permission denied». I’ve read countless threads and still cant get it.
I can get everything started,
F:Android SDKtools
F: adb devicesThan it list my devices. Than I type in
F:adb shell and I get a «$» sign.
Anything I type after that I get permission denied.
I tried adb push [insert file here] /system/app I get
«ADB: Permission Denied.»
I tried adb remount, I get ‘ADB: Permission Denied»
Here is my log:
Any help
-
Download the Forums for Android™ app!
Download
-
Are you supposed to be in fastboot USB when doing this?
-
You have to boot into recovery first to push files into system I believe since you are not rooted.
-
Thread Starter
-
In the adb shell
adb reboot recovery
Question though, I’m guessing you dont want to root your phone?
-
Whoops sorry that wouldn’t help. You would still need root for su permissions for /system.
-
you are not using adb correctly.
1) if you are using adb shell, you are now in shell mode, and you should be using standard linux commands. The «permission denied» error you are getting is misleading. If you type kjdzgkjfdlkgdhgslkhfdg and press enter, it will say permission denied. You should read the error as «unknown command.»
2) if you want to use adb to push files to your phone, you need to do that from your windows prompt, not inside adb shell. For example:
3) I believe that you need to specify the target file name. it’s not enough to specify the directory. See my push example above.
4) /system/app is a root-only area. You can’t mount that writable without root. So even if you got all the syntax right, it wouldn’t work. You are right, though. Not all areas are protected, and you can indeed push files to your phone without root. /system/* is not one of those areas.
Hope that helps.
-
You can root your phone
To even attempt what you are trying to do seems to indicate you’re the type of person that would enjoy the benefits of rooting.
I’d give it some thought. And there’s lots of ppl here to help you through it. If you do your research and understand what’s going on, it’s pretty hard to screw up your phone trying to root it.
-
novox,
Any idea what I’m doing wrong?
I’m use a MacBook Pro. I was trying to push a boot animation with adb after 5 hours just gave up.
I DL’d SDK Android for Mac, put the boot animation zip in the tools folder, put the phone into recovery (bootloader usb) and connected it to my Mac, opened up Terminal and tried the following coomands:
./adb remount
./adb push bootanimation.zip /system/customize/resource
./adb rebootThis is what Terminal said:
I just can’t get adb to work. No idea what I’m doing wrong.
-
based on your screenie, my guess is that your current directory is not the /tools directory of the SDK. Therefore, when you call ./adb, your computer is saying, «I don’t see the command adb in this current directory.»
A few unix basics:
~ = home directory
. = current directory
.. = parent directory
pwd = command to show you what directory you are in
cd ~ = go to your home dir. In your case, it appears to be johngirgenti/
cd .. = go back one directory (the parent)
cd / = go to the root directory (the parent of all folders; the root)
ls -al = list contents of the current directory in vertical list format and showing all hidden files (files beginning with a dot).With these commands, you should be able to navigate the directories on your mac from the terminal.
when you say ./adb, you are saying current directory/adb. Based on your prompt, you seem to be in your home directory. Unless you have defined the location of adb in your PATH environment variable, you can’t just run adb from any location. I don’t know where the default location of the android SDK is for the Mac, but you should navigate there (tools directory) and try your ./adb command from there.
You are trying to replace the stupid 4G animation with your own 1337 animation. Here’s how I’d do it, once you’ve verified you can get adb running:
Do this while your phone is in custom recovery.
-
I thought I had it this time. Rebooted the phone and the animation wasn’t there…I think I give up…lol
-
wrong directory. push it to /system/customize/resource/bootanimation.zip
**also note, you need to specify the target file**be sure to mount /system first.and there’s also an mp3 file you can replace in /system/customize/resource. it’s the one that plays with the boot animation. sounds like crap.
-
Gotcha…what do you mean by mount /system first?
Sorry…slowly learning this adb stuff
.
Yeah…have an mp3 file too….just push it the same way right?
-
Any idea?
-
Again….thought I had it this time
EDIT: SUCCESS!!! THIS WORKED!!
-
Tried to do the mp3…thought I had it but on reboot it didn’t play, any idea’s?
Tried this too…didn’t work
-
Did it play the original sound at all? If not, then I’m guessing the issue is with your mp3 file. try something standard like 44khz@128.
Looks like your locations are different than mine. for me, on 2.1, the boot animation was in /system/customize/resource, and the sound was in /system/media. In 2.2 (for me), the sound was moved to /system/customize/resource, and it was also renamed.
-
Pay close attention until you get the hang of it — ./adb means «execute adb from here» — .adb means nothing.
-
Yeah…I’ve been typing ./adb for hours…couple times I forgot the / in there..lol
Finally got it to work. Changed the file name to android_audio.mp3 and it finally flashed correctly.
-
sounds like you are still on 2.1? that file name and location rings a bell for my old 2.1 boot mp3.
-
- htc evo 4g
Share This Page
When I tried to install ADB through the terminal on Ubuntu, it told me «permission denied»:
~/android-sdks/tools/ $ ./android
bash: ./android: Permission denied
~/android-sdks/platform-tools/ $ ./adb devices
bash: ./adb: Permission denied
Can anyone help me with this?
slhck
219k68 gold badges592 silver badges580 bronze badges
asked Jun 8, 2012 at 20:35
Make sure the android
file (and others) are executable.
If you run chmod +x android
, that should set the executable permission, which would allow you to run the binary.
To do this for all files in tools
or platform tools
, simply run:
chmod +x ~/android-sdks/tools/*
chmod +x ~/android-sdks/platform-tools/*
answered Jun 8, 2012 at 21:07
slhckslhck
219k68 gold badges592 silver badges580 bronze badges
check if the commands are exacutable:
ls -l adb
-rw-r--r-- 1 tsi tsi 0 Aug 5 11:58 adb
my user is «tsi», and I don’t have e’X’ecute permissions on it, now make it executable:
chmod +x adb
ls -l adb
-rwxr-xr-x 1 tsi tsi 0 Aug 5 11:58 adb
Now it should be ok.
What else could prevent to make it executable?
- the files are not on a linux filesystem
- they are on a linux filesystem, but it is mounted without execution permissions
answered Aug 5, 2015 at 10:02
same problem happened for me
open the terminal and check whether adb server properly installed by the using the command
adb version
if not installed error shows then type the following command t install after that everything worked fine for me.
The program 'adb' is currently not installed. You can install it by typing:
sudo apt-get install android-tools-adb
answered Aug 5, 2015 at 9:40