I'm trying to install via ADB an .APK on an Android box.
So I connect to it via ADP and try to install.
$adb connect 192.168.0.33
connected to 192.168.0.33:5555
$adb -s 192.168.0.33:5555 install -r Myapk.apk
pkg: /data/local/tmp/Myapk.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATIOTES]
Myapk.apk is an apk that I lost source code, so I've extract, edit it, compile and signed it back. That app works on my Nexus 5.
Edit:
It was a visual bug. I just had to reboot the device.
Try to -> pm uninstall "com.yourpackage.example" before. Examine if there sais "Success"
Perhaps there iss only mismatch on apk signing
Related
I was following the instructions given on this https://developers.google.com/ar/develop/java/getting-started Google Developers Website but when I tried to install the APK file on my Android Device via Terminal (macOS)
Terminal gave me this error:
$ adb devices -l List of devices attached 93eafadd device usb:336592896X product:kenzo model:Redmi_Note_3 device:kenzo
$ adb install -r -d arcore-preview.apk Invalid APK file: arcore-preview.apk Sayans-iMac:~ sayan$
So I even transferred the APK to my Android device and tried to install it in the Android device it self manually, but I got this error: error parsing package!
I don't know why this is happening and I have also enabled USB debugging!
I had this same problem, but had not pointed adb to the right package:
adb install -r -d ~/Downloads/arcore-preview.apk
"Your download directory might vary."
I can install the apk and debug and everything works fine, but then (what seems randomly) it starts giving me the following error when I try to install/debug the app:
09/16 07:53:46: Launching app
$ adb push C:\Workspace\new-project-template-master\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.wolf.androidthings.autoherb
$ adb shell pm install -r "/data/local/tmp/com.wolf.androidthings.autoherb"
Error: android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
$ adb shell pm uninstall com.wolf.androidthings.autoherb
$ adb shell pm install -r "/data/local/tmp/com.wolf.androidthings.autoherb"
Error: android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
$ adb shell pm uninstall com.wolf.androidthings.autoherb
Unknown failure (at android.os.Binder.execTransact(Binder.java:674))
Error while Installing APK
The only way I can fix this problem at the moment is flashing the Android Things image again, which is not ideal..
Any ideas on why this is happening?
PS. This is when doing a debug install via Android Studio
I've seen this on Android Things with Raspberry Pi. As you have noticed, uninstalling the app via adb doesn't work. I connected with the console via serial and noticed that I was out of space on the filesystem. I had some big log files associated with my app (not sure where, somewhere in /data/...). I removed those (as in rm -f ...) and then my app installed fine.
I'm running nixos and I have a .apk file, i.e. an Android app.
There is the handy tool adb (Android Debug Bridge) and the command
adb install /path/to/app.apk
How do I get it to work on nixos?
The binary adb is in androidsdk. So either run
nix-env -i androidsdk
or add androidsdk to the list environment.systemPackages in /etc/nixos/configuration.nix.
Your Android phone needs to be plugged in and have USB debugging enabled as documented on developer.android.com.
Simply running adb install ... didn't work for me. Instead I did
sudo adb start-server
adb install /path/to/app.apk
or
adb install /path/to/app.apk -r
for overwriting an already installed app.
I use ADB tool and I want to install apk on my emulator. So I use this command
adb install /home/jody/myexample.apk
and I got this error
2841 KB/s (242867 bytes in 0.083s)
pkg: apk
ver: /data/local/tmp/concolicexample.apk
Failure [INSTALL_FAILED_INVALID_URI]
I search this error and from https://mobiledevstories.wordpress.com/2013/06/03/android-adb-install_failed_invalid_uri/ I found out I should The solution is to change permissions to directory but the problem is I don't know where is /data/local/tmp and where should I change permissions?
I should mention that I use genymotion emulator on Linux.
please help me. Sorry if this problem is really primitive. I just begin to use adb.
There are more people with your problem here:
Cannot install package on rooted device : INSTALL_FAILED_INVALID_URI
I think that your device needs to be rooted for this to work, or you won't have sufficient rights. I don't have a rooted device here so don't remember if all steps are necessary:
So the /data/local/ directory is on the Android device, so using adb you need to access the device.
1) adb remount (This might not be necessary, this gives you more access rights to the device)
2) adb shell <- opens a shell on the device instead of your computer.
3) chmod 777 /data/local/
4) chmod 777 /data/local/tmp/
Hopefully it works for you!
I have tried to install my apk using adb like this:
D:\C_Desktop\Development\Android SDK\platform-tools>adb install "C:\test_haxe\bin\android\bin\bin\testhaxe-debug.apk"
4274 KB/s (3702929 bytes in 0.846s)
pkg: /data/local/tmp/testhaxe-debug.apk
Success
so, its installed fine, but at my phone, I couldn't find the apk file, is it deleted after being installed?!
also, I tried to uninstall it like this:
adb uninstall com.ketab.haxe
but I get
Failure
Because I have no emulator, I will have to install the app each time to see the progress, so I will need to uninstall it and then install the new app on my phone, is this the right way to go any way?
to find out the apk file location after installation use pm path <package> command:
adb shell pm path com.ketab.haxe
you could try uninstalling the package with:
adb shell pm uninstall com.ketab.haxe
in case of failure check the error message with:
adb logcat -d -s PackageManager:*
Linux/mac users can also create a script to uninstall ("delete") an apk with something like the following. Create a file named adb-uninstall with these 3 lines:
pkg=$(aapt dump badging $1|awk -F" " '/package/ {print $2}'|awk -F"'" '/name=/ {print $2}')
adb uninstall $pkg
Then chmod +x adb-uninstall to make it executable.
now you can simply:
adb-uninstall myapp.apk
The benefit here is that you don't need to know the package name. Similarly, you can create adb-run myapp.apk.
Note: This requires that you have aapt in your path. You can find it under the new build tools folder in the SDK.
[with solution] I couln't find the apk file on my android device after installing successfuly from the command line my app apk (adb install ~/Downloads/myapp.apk) . After searching my phone's File Manager, I found out the app was downloaded as an APP and not as an apk file, as I had expected.
So if anyone else was looking for the apk file - it's an application and not a file you can see