From few days Device File Explorer of Android Studio shows me this message:
Error executing shell command pm list packages
And can't see files and apps from data folder, for example gets database from my Flutter app. Any ideas to solve this problem? Thanks in advance!
UPDATE 29/11/2022
After searching a little I found way to execute adb shell commands from windows CMD, when executes 'adb shell pm list packages' command the CMD throws this Exception:
Exception occurred while executing 'list':
java.lang.SecurityException: Shell does not have permission to access user 150
com.android.server.am.ActivityManagerService.handleIncomingUser:14872 android.app.ActivityManager.handleIncomingUser:4802 com.android.server.pm.PackageManagerShellCommand.translateUserId:3499
at com.android.server.am.UserController.handleIncomingUser(UserController.java:2672)
at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:14872)
at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:4802)
at com.android.server.pm.PackageManagerShellCommand.translateUserId(PackageManagerShellCommand.java:3499)
at com.android.server.pm.PackageManagerShellCommand.runListPackages(PackageManagerShellCommand.java:965)
at com.android.server.pm.PackageManagerShellCommand.runListPackages(PackageManagerShellCommand.java:861)
at com.android.server.pm.PackageManagerShellCommand.runList(PackageManagerShellCommand.java:720)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:222)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6922)
at android.os.Binder.shellCommand(Binder.java:1085)
at android.os.Binder.onTransact(Binder.java:903)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4909)
at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6906)
at android.os.Binder.execTransactInternal(Binder.java:1321)
at android.os.Binder.execTransact(Binder.java:1280)
According forums and other websites this code 150 signify that android studio try to open device file explorer in Samsung Secure Folder when my Flutter app it's installed in normal device storage, this error apparently appairing in Samsung devices with Secure folder. How we execute Device File Explorer in normal device storage, any idea?
I've this problem too. I've uninstalled the Secure Folder to use the Device File Explorer still somebody get the solution
Android Studio Error: One UI 5 upgrade (Android 13) Adb error executing shell command pm list on data/data/ folder
Related
When I try to deploy a Xamarin Forms Android app to my Samsung S4 I get the following error message:
Deployment failed because of an internal error: Package /data/local/tmp/de.tradino_shop.pinkweather-Signed.apk already exists on device.
I looked for the file and wanted to delete it but the file does not exist at the given location. Does anybody have an idea what I could do to resolve this? By the way, the App shows up in Application Manager but can't be deleted or executed. It just says: not installed.
I had the same problem and I solved it by using the command prompt.
In the command prompt go to the file where adb exist in C:\Program Files (x86)\Android\android-sdk\platform-tools) and also you must put the de.tradino_shop.pinkweather-Signed.apk file in that folder (you will find it in the debug file of your project) then just in the command prompt execute this line: adb install -r de.tradino_shop.pinkweather-Signed.apk
After installation finish just clean your project and debug again. Your android phone must be connected to your PC and is on USB debugging mode.
Try to go to Settings -> Apps -> All Apps. The path may be different but you need to check the list of all the installed apps and see if your app is in the list. if it is in the the list than uninstall it for all the users.
I've tried every proposed solution on the internet and nothing is working. Android studio was working fine then one day out of nowhere it kept giving me this error on every project
unable to locate adb
I tried navigating to my adb.exe and kill-sever and restart it but the adb.exe directory is not in my platform-tools folder under sdk.
I've tried uninstalling android studio and reinstalling it. A post suggested that it could be my AVG security but that was not the issue. I've tried updating the platform-tools and it freezes here
Close android studio.
open a command window.
type adb devices
no devices?
trouble shoot connection and drivers and device developer option
see a device?
type adb shell
type ls -l
type su
su not found? download or activate your superuser app
no problems with any step?
open android studio and try again with it's terminal emulator
I am building an app with ai2 but I have spend hours trying to get their emulator to work, so I have exported myapp.apk and I am trying to launch it on android studio emulator.
I have followed several tuto included the answer proposed by Tarek on that thread But I am getting and error on cmd.
Here is what I tried:
run android studio as administrator, run the emulator via the AVD manager, waited until it's started.
move myapp.apk in the sdk/platform-tools folder
created a run.bat file in this folder and wrote CMD in it5. copy your desired apk to the same folder
double click on run.bat and wrote: adb install r- "myapp.apk"
Here I am getting an error on CMD: error device not found -waiting for device-. I don't understand because my emulator is running.
I have also tried to launch the emulator without starting android studio with this command emulator -avd <avd_name> [<options>] but I get this message "the system cannot find the file specified".
The error message appears because adb cannot connect to the device although it is running. This is not supposed to happen, but it does from time to time.
You can always check if adb can see the emulator by running adb devices, which should result in a list of devices it can see. If this list is empty, the device is not found. You can resolve this by adb kill-server, waiting a couple of seconds and then running adb start-server. Try running adb devices again, and the device should be listed, and the installation should succeed.
Starting an emulator can be done by running emulator #<device-name> [options]. The device name can be found by running android list avd. This will result in a list of devices of which the <device-name> will also be listed.
i have a problem. When i am trying to deploy (Debug or Run) my App with the AndroidStudio, i get the following error in the RunLog
Waiting for device.
Target device: samsung-galaxy_nexus-WOVCBUF6BAGENRTO
Uploading file
local path: C:\Users\Abracadabra\Desktop\......\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/xxx.xxx.app
Installing xxx.xxx.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/xxx.xxx.app"
Segmentation fault
It works fine when i try to deploy it to the genymotion VM. It just does not work on my real device. It did work before, but i have cleaned up some folders there with the rootExplorer, for example i deleted a folder called ".Idea". Maybe this was a big mistake?
Is this the reason why it does not work anymore?
By the way, logcat is working fine for the rest of the phone.
Thanks for any help!
P.S. I also installed a fresh android with the CWM recovery tool and wiped all user and cache data -> did not help.
P.P.S I found out, that the apk is in /data/local/tmp on the phone. I can install it manually with the rootExplorer. but debugging is also not possible :/
P.P.P.S: I also have tried "adb install", also gives me segmentation fault.
It seems that copy is possible, but installation not.
Found out the reason. (a quite stupid one)
I forgot to enable "Security Settings -> Unknown Sources"
I encountered the same problem.
Waiting for device.
Target device: samsung-gt_n7100-4df180b77e139fdd
Uploading file
local path: C:\Users\Harshal\AndroidStudioProjects\MyFirstApp\CurrentAffairs\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.softcode.anupreet.currentaffairs
Installing com.softcode.anupreet.currentaffairs
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.softcode.anupreet.currentaffairs"
Segmentation fault
I downloaded the 'Terminal Emulator' app on my device and ran the below two commands, it was a success.
su -o pm install -r "/data/local/tmp/com.softcode.anupreet.currentaffairs"
I am trying to install an apk (downloaded from one site) in ICS emulator through adb shell but its giving following error:
Failure [INSTALL_FAILED_UID_CHANGED]
What could be the issue?
Simply rm -r the data directory in question. If you were installing and got this error, you'd simply run "rm -r /data/data/com.app.class" from an ADB shell. If you want to try preserving the data, you could find the proper UID and then "chown -R UID:UID /data/data/com.app.class".
In Android, the part of the source code that handles installing apps is PackageManagerService. Since the Android source is public, it's easy to see where Android will throw a INSTALL_FAILED_UID_CHANGED error. If the following is true: the package you are installing already has a data directory AND the permissions on that data directory are different than the UID assigned to this package, you'll get that error.
Uninstall the previous version of the app from the emulator first, then try again. You can do this by visiting System Settings > Applications > Manage Applications and selecting the app.
If the app still fails to install, then start the emulator with the Wipe user data option selected.
Open command prompt and write below code in it:
adb devices
This will list down the number of devices attached or are active.Copy your apk in your System folder
adb -s DEVICE_NAME install YOUR_APK_NAME
through this you will be able to install your particular apk on the device by giving device name in above line.