In Android Studio, i want run my app in my device but i have an error message:
$ adb shell pm install -r "/data/local/tmp/my.model" /system/bin/sh:
pm: can't execute: Permission denied
(It launch perfectly in emulator with 0 error.)
I have a Samsung S3 Mini rooted phone. My phone is visible with command adb devices.
I have try: run Android Studio in administrator, add ADB path on environment variable, Remove build folder and rebuild project, but i have always this error.
I guess that's why it does not start my Activity.
$ adb push C:\Users\me\AndroidStudioProjects\Model\app\build\outputs\apk\app-debug.apk
/data/local/tmp/my.model
$ adb shell pm install -r "/data/local/tmp/my.model"
/system/bin/sh: pm: can't execute: Permission denied
$ adb shell am start -n "my.model/my.model.MainActivity" -a
android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "my.model/my.model.MainActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] cmp=my.model/.MainActivity }
Error type 3
Error: Activity class {my.model/my.model.MainActivity} does not
exist.
Error while Launching activity
Where is the issue? Thank you.
I have found why it not working. Because pm manager is disabled.
For resolve this issue:
Connect your phone to the pc
Open a command line and write adb shell and press enter
Write su and press enter
Now write chmod 777 /system/bin/pm
Enjoy!
You do this using adb
adb root (root access)
adb shell (Enter as root)
mount -o rw,remount / (for permission write access)
rm system/app -r Instagram (remove folder)
rm system/app -r Instagram/instagram.apk (remove apk)
Related
I tried to use the following code, but reported to me "shell does not declare android.permission.REQUEST_INSTALL_PACKAGES"
adb shell am start -a android.intent.action.VIEW -t "application/vnd.android.package-archive" -d "file:///sdcard/Download/a.apk"
I am sad that for some reasons, adb install is not allowed, even if I run the following command, I still cannot install the application
adb shell settings put global verifier_verify_adb_installs 0
adb shell settings put global package_verifier_enable 0
log:Failure [INSTALL_FAILED_VERIFICATION_FAILURE: adb install not allowed!]
I get a trouble when learning android Data-Persistence.
I changed the daenter image description hereta/data/com.flexible.filepersistencetest/files/data permission to 777. But I still can't pull it to my PC.
when I try to delete Nexus_5_API_24.avd 's permission of Read-Only, the Read-Only will be back.
It really exaust me.
Any advice is ok, thank you very much!
change file permissions.
C:\Android\sdk\platform-tools> adb shell
generic_x86:/ $ su
generic_x86_64:/ # chmod -R 777 /data
generic_x86_64:/ # exit
run the below commands under the terminal in Android studio integration.
C:\Android\sdk\platform-tools> adb shell
generic_x86:/ $
generic_x86:/ $ exit
$ adb root
restarting adbd as root
$ adb shell
generic_x86:/ # exit
open cmd windows.
C:\Android\sdk\platform-tools> adb pull /data/data/xxxx C:\Android\sdk\platform-tools
or use "pull" button
I'm developing apps for Android Wear and Android Phone devices. Both apps are in a common project in Android Studio. In fact this application uses three wear devices that work together with a single phone. So when I recompile for app testing, I need to build and install the apps on one phone AND three wear devices every time. Is there a way to automatically build and install to all four of these devices with one command? I imagine that a script could be run from the terminal in Android Studio, but I'm not sure where to start. Thanks.
Following the recommendations above from cricket_007, I started digging around Android Studio to see if it would report the commands for installation. I found the commands, put them in a shell script file and am now able to install the apk to four wear devices at once.
So first, in Android Studio, I go to: Build | Build APK. The generates the wear apk file. Then I execute a shell script with the following commands:
echo "Installing 422E..."
adb -s G6NZCJ00401422E push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G6NZCJ00401422E shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 422E..."
adb -s G6NZCJ00401422E shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Installing 6227..."
adb -s G6NZCJ004076227 push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G6NZCJ004076227 shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 6227..."
adb -s G6NZCJ004076227 shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Installing 922a..."
adb -s G5NZCJ02746922A push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G5NZCJ02746922A shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 922A..."
adb -s G5NZCJ02746922A shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Done."
echo "Installing Moto…”
adb -s localhost:4444 push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s localhost:4444 shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting Moto…”
adb -s localhost:4444 shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Done."
Of course, this could be extended to install the mobile app as well. I'm sure that I can find the gradle command to actually compile the .apk file as part of the script. If I find that, I will also post it.
i am trying to pull db from my app but i keep getting this error in eclipse->DDMS->FileExplorer
[2014-08-07 12:53:03 - ddms] transfer error: Permission denied
[2014-08-07 12:53:03] Failed to pull selection: Permission denied
i tried to do it from CMD with this command
C:\Android\sdk\platform-tools>adb -d shell
shell#android:/ $ run-as com.iqpandroid
run-as com.iqpandroid
run-as: Package 'com.iqpandroid' has corrupt installation
as u can see the message that installation has currupt installation.. can somebody help?
Execute this command from terminal:
adb root - restarts the adb daemon with root permissions
As far as I am aware you will need to have root access.
From terminal:
adb shell
su
chmod -R 777 /data/data/com.your.package
I can use all adb features, but when i try to adb -r install /package.adb it just gives me:
"2858 KB/s (4116553 bytes in 1.406s)"
and thats it, nothing happens. When I do it on another computer it deploys application and restarts it. What can be wrong?
Try running this command after your install:
adb shell am start -a android.intent.action.MAIN -n your.package/.possibleSubfolder.MyMainActivity