Install apk via ADB [ Failure [INSTALL_FAILED_INVALID_URI] ] - General Questions and Answers

Hey guys,
I try to install a apk file on my xperiaS via adb USB debugging connected.. I have this custom ROM installed: http://forum.xda-developers.com/showthread.php?t=2788234
I have setup my fastboot drivers and installed the latest 'Minimal ADB & Fastboot' from xda.. When I type my first command:
adb devices
I get the correct reply:
Code:
C:\Minimal ADB and Fastboot>adb devices
List of devices attached
CB511XGGNQ device
But when I try to install the APK, I get this reply:
Code:
C:\Minimal ADB and Fastboot>adb install app keepass2android.apk
3381 KB/s (17055729 bytes in 4.926s)
pkg: app
ver: /data/local/tmp/keepass2android.apk
Failure [INSTALL_FAILED_INVALID_URI]
- I have enabled 'Unknown sources' in Security settings
- I unchecked 'Verify apps over USB' in dev options..
What am I doing wrong?, why does it fail to install..

Anyone?

Getting this when installing via shell, but not while using ADB. Did you figure out what it was?

Related

[How To]ADB&ANDROID

Hi all,
Today i will tell you about ADB.
1. What's ADB?
ADB (Android Debug Bridge) is a versatile COMMAND LINE TOOL that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:
* A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
*A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
*A daemon, which runs as a background process on each emulator or device instance.
2. How Can i Get it?
For Windows...You can Download the Attachment...For Other OS you Have to Install SDK and After go to <SDK>\platform-tools to get the same file of Windows but now for Linux or Mac!
NOTE: SOMETIMES ADB DON'T WORK TO BE SURE IT WORK INPUT IN CMD adb devices (no caps) ---> If After "List of..." You Get a Code with Device is all Ok.
0123456789ABCDEF device
But if You don't Get the code you have to install HTC SYNC for Android....
And After Retry with "adb devices" and if you get the code you can Use Adb..
In my Opinion you can Put the folder in C:\Android and made a link on Desktop...
3. Command to Use ADB and Their Function:
Android Debug Bridge version 1.0.26
(**MOST USED**)
Code:
adb push <local> <remote> - copy file/dir to device
Code:
adb pull <remote> <local> - copy file/dir from device
Code:
adb sync [ <directory> ] - copy host->device only if changed (see 'adb help all')
Code:
adb shell - run remote shell interactively
Code:
adb shell <command> - run remote shell command
Code:
adb emu <command> - run emulator console command
Code:
adb logcat [ <filter-spec> ] - View device log
Code:
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
Code:
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
Code:
adb version - show version num
Code:
adb -w - wipe the data partition
Code:
adb -d - flash the data partition
Code:
adb wait-for-device - block until device is online
Code:
adb start-server - ensure that there is a server running
Code:
adb kill-server - kill the server if it is running
Code:
adb get-state - prints: offline | bootloader | device
Code:
adb get-product - prints: <product-id>
Code:
adb get-serialno - prints: <serial-number>
Code:
adb status-window - continuously print device status for a specified device
Code:
adb remount - remounts the /system partition on the device read-write
If You Need Help Ask Here.
I Hope This Thread will Be Usefull...

[Q] 2.20 root on mac?

sorry for the noob question, but i am new to android and new to rooting. is there a way to do this on a mac that isnt running a windows partition? if so is there an explanation?
jasonr803 said:
sorry for the noob question, but i am new to android and new to rooting. is there a way to do this on a mac that isnt running a windows partition? if so is there an explanation?
Click to expand...
Click to collapse
1. Make sure you have installed ADB and FASTBOOT command line tools first. You can install them from here: http://code.google.com/p/adb-fastboot-install/
2. Download djrbliss's exploit files. You can find it here: http://forum.xda-developers.com/showthread.php?t=1952038
3. Extract the entire zip file.
4. Connect your device via USB, ensure USB debugging mode is enabled.
5. Open Terminal and enter into the folder that you extract that zip file.
6. Just type the following command lines step by step:
1. adb wait-for-device
May be you will see this information in your terminal
=======================================
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
=======================================
2. adb restore backup1.ab
3. adb shell "rm /data/data/com.android.providers.telephony/databases/a/b 2>/dev/null"
4. adb shell "ln -s /dev/diag /data/data/com.android.providers.telephony/databases/a/b 2>/dev/null"
5. adb restore backup2.ab
6. adb push pwn /data/local/tmp
After this you can see some information in your terminal like this:
========================================
1180 KB/s (64526 bytes in 0.053s)
========================================
7. adb shell "chmod 755 /data/local/tmp/pwn"
8. adb shell "/data/local/tmp/pwn"
After this if you see this in your terminal that means you are close to success:
========================================
[+] Set CID!
========================================
9. adb reboot bootloader
In this step, just keep waiting until your phone enter into fastboot mode, then excute step 10.
10. adb kill-server
11. fastboot oem readcid
If you see the cid like this you are success!!!
========================================
...
(bootloader) cid: 11111111
OKAY [ 0.010s]
finished. total time: 0.010s
========================================
12. fastboot oem get_identifier_token
Finally you can get your own identifier token.
For some reason the adb commands dont work for me. Is there something I'm missing?
Edit: Figured it out but now I get a "Failed." error when I type adb shell "/data/local/tmp/pwn"
jasonr803 said:
sorry for the noob question, but i am new to android and new to rooting. is there a way to do this on a mac that isnt running a windows partition? if so is there an explanation?
Click to expand...
Click to collapse
instructions have been updated and there is now a script for mac you can execute in terminal
http://forum.xda-developers.com/showpost.php?p=33178597&postcount=1
h1m said:
For some reason the adb commands dont work for me. Is there something I'm missing?
Edit: Figured it out but now I get a "Failed." error when I type adb shell "/data/local/tmp/pwn"
Click to expand...
Click to collapse
I also encounter this problem. Try to factory reset your phone first. I do this then it works fine.

[Q] Cant get kindle fire into fastboot

Ive been trying out pokey'9000 [fastboot] stock 6.2.1 fastboot mode without rooting or cables to get my kindle fire into fastboot, I typed in the"adb shell " command and get:
"[email protected]: $" so i guess adb is working I then follow the next step,
"adb push fbmode /data/local/tmp"
and get:
"942 KB/s (510876 bytes in 0.529s)" then:
"adb shell chmod 755 /data/local/tmp/fbmode
adb shell /data/local/tmp/fbmode"
but just after this final line I get:
"fail opening shift: No such file or directory"
My kindle is rooted and has superuser access already but I cant get it into fastboot mode, also tried:
" adb shell su -c 'idme bootmode 4002' "
and get :
" Reading idme data...
Setting bootmode to 4002
writing new vars to temp area
you must reboot before new values will take efect "
I reboot my kindle bust still cant get into fastboot. What could I possibly be doing wrong?

Teclast Tbook 16 Power (M5F8) root

I want to get root.
Does not work.
Turn on USB debugging
Bootloader unlock:
Code:
adb reboot bootloader
fastboot flashing unlock
Erase and flash recovery:
Code:
fastboot erase recovery
fastboot flash recovery TWRP_2_8_7.img
Reboot recovery.
TWRP - Install zip - SuperSU.zip
E:Unable to mount 'factory'
Rebood system.
SuperSU - not installed
Root - not installed
Go to fastboot:
Code:
adb reboot fastboot
Erase and flash recovery:
Code:
fastboot erase recovery
fastboot flash recovery TWRP_3_0_2.img
Reboot recovery.
TWRP - Install zip - SuperSU.zip
Is installed without errors.
Rebood system.
SuperSU - not installed
Root - not installed
---
ADB install:
Code:
adb root
adb remount
adb shell mkdir /system/bin/.ext
adb shell chmod 777 /system/bin/.ext
adb push su /system/bin/.ext/.su
adb shell chmod 6755 /system/bin/.ext/.su
adb push su /system/xbin/su
adb shell chmod 6755 /system/xbin/su
adb push busybox /system/bin/busybox
adb shell chmod 6755 /system/bin/busybox
adb shell mkdir /system/app/SuperSU
adb shell chmod 755 /system/app/SuperSU
adb push SuperSU.apk /system/app/SuperSU/SuperSU.apk
adb shell chmod 644 /system/app/SuperSU/SuperSU.apk
adb reboot
SuperSU - installed, but error on run: "SU Binary occupied"
Root - not installed
Help me please!
Root teclast tbook 16 power (m5f8)
First off, I take no responsibility for bricked devices!
Things you need before you start: charged tbook 16 power (M5F8)
!! usb mouse or keyboard dock, since touch in twrp is NOT working!!
usb-c cable
minimal adb and fastboot https://forum.xda-developers.com/showthread.php?t=2317790
usb drivers https://software.intel.com/en-us/android/articles/intel-usb-driver-for-android-devices
isoc drivers https://androiddatahost.com/te67m
1. Start your tablet and navigate to developer settings. Check usb debugging, oem unlock and uncheck analyse apps through usb
2. download latest magisk.zip to your tablet and put it in the root of the sd card
3. download attached twrp img(https://www.dropbox.com/s/rrngzwq2uvaq05l/TWRP-2.8.7.0_teclast_Tbook16Power-beta03.img?dl=0) and put it in the same folder where adb and fastboot is located
4. Connect the tablet with pc through usb-c cable
5. install minimal adb and fastboot
6. Sart a command prompt in the folder where adb is located (shift + right click)
7. type -adb reboot fastboot- and click enter (tablet enters fastboot mode)
8. type -fastboot flashing unlock- (!!! caution !!! USERDATA of android will be ERASED, like factory reset) and click enter
9. type -fastboot boot TWRP-2.8.7.0_teclast_Tbook16Power-beta03.img- and click enter
10. on twrp swipe right(mouse or keyboard dock needed!) to allow modifications, if it aksks you to root your device click no
11. click install and navigate to the magisk.zip file located on the tablet. click install, magisk will be installed and your device will be rooted
12. click reboot, first reboot takes about 5 minutes. Voilà!
It works!
Very good!
Thank you!
Thank you very much!!!
easy way, thank you.
Hi, I tried this guide just a teclast tbook 16 power, but it doesn't work for me, I don't install Magisk-v18.1.zip, from compatibility errors.
Why?

Adb and fastboot list

ADB Commands​
Adb Install app remotely
adb install appname.apk
Adb pull file
adb pull <path-of-the-file> (on device e.g. /system/app/Settings.apk)
Adb push file
adb push <source-path> <target-path> (/local/path/Reddit.apk /sdcard/apps/)
Adb Check devices
adb devices
Adb boot into bootloader
adb reboot-bootloader
Adb boot into recovery
ADB reboot recovery
Adb Sideload
adb sideload filename.zip
Adb start server
adb start-server
Adb kill server
adb kill-server
Adb shell command
adb shell "<command>"
Adb install apk
adb install filename.apk
Adb re install apk
adb install -r filename.apk
Fastboot Commands​
Fastboot check devices
Fastboot devices
Fastboot flash image file
fastboot flash recovery filename.img
Fastboot flashing boot.img
fastboot flash boot
Fastboot flash radio file
fastboot flash radio radio.img
Fastboot reboot device
fastboot reboot
Fastboot enter recovery
fastboot reboot recovery / fastboot boot twrp.img (a/b partition devices)
style='mso-bidi-font-weight:normal'>
Fastboot bootloader
fastboot reboot bootloader
Noticed that among others the most important ADB command
adb shell "<command>"
what opens a terminal shell and let you e.g. run Linux-commands / scripts is missing.
See also here:
Adb useful commands list
Adb useful commands list. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
jwoegerbauer said:
Noticed that among others the most important ADB command
adb shell "<command>"
what opens a terminal shell and let you e.g. run Linux-commands / scripts is missing.
See also here:
Adb useful commands list
Adb useful commands list. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
Click to expand...
Click to collapse
Thanks added

Categories

Resources