Deploy an apk to Android device using adb - android

Hello I want to deploy an apk to my physical mobile device using this command:
adb install android-debug.apk
And I got this error :
adb install android-debug.apk
[100%] /data/local/tmp/android-debug.apk
pkg: /data/local/tmp/android-debug.apk
android.os.TransactionTooLargeException
Error: Could not access the Package Manager. Is the system running?

You have to physically unlock your device's lockscreen and make sure you have usb debugging enabled. Here to where I read the answer, remember, search before you post.

Related

Android ADB shell: Enable USB app installation

I have a question about APK installation internals.
If you want to install an APK on some Android devices via ADB (adb install APK.apk or pm install /data/local/tmp/APK.apk) you have to enable USB installation in Developer Options. If the USB installation is not enabled, you'll be presented an error on installation, most likely something like
adb: failed to install app.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Installation blocked]
My questions are:
How is enabling/disabling of the USB installation implemented in the system? At what point does the error above occur?
Is there a way how to enable USB app installation via ADB? I know I could write a script that calls input tap X Y or similar GUI commands, but that's not what I want. What I'd like to know is whether there is an entirely non-GUI way of doing this, something like setprop install.via.usb 1 or echo 1 > /system/etc/install_via_usb
I'm interested in ways to do this for both rooted and unrooted devices.

Expo - Error running adb: more than one device/emulator

I am running macOS Catalina, and have one Android emulator set up in the Android Virtual Device Manager.
Before starting the emulator, on a freshly rebooted system, if I run adb devices I get:
List of devices attached
emulator-5562 offline
After starting the emulator, adb devices returns:
List of devices attached
emulator-5554 device
emulator-5562 offline
If I fire up Expo and try to run on the Android emulator, I get this error:
Couldn't start project on Android: Error running adb: more than one device/emulator
It looks like the offline emulator-5562 is the problem here? But it's still there even after rebooting my computer. All the advice I've read (i.e. adb kill-server and adb restart-server) makes no difference. There are no Android devices connected via USB.
How can I delete the "offline" device? Or alternatively, how can I point Expo to the one actual Android emulator I have running?
Try this:adb -s emulator-5554 <command>

Installing an apk through adb - aborted

https://github.com/JonWoodlief/android-pololu-maestro-ssc
I'm intending to use this to learn how to manipulate servos connected to a pololu maestro card hooked up to my android via micro-usb to mini-usb cable. I'm running a verizon Galaxy S5 (SM-G900V) and I'm rooted on android 5.0. I'm running Wireless ADB using Konnect-ADB.
when I run
adb install C:\AndroidStudioWorkspace\android-pololu-maestro-ssc-master\app\build\outputs\apk\app-debug.apk
I get
[100%] /data/local/tmp/app-debug.apk
Aborted
Any clue to what the problem is, or what i can do to find the problem?
Try adb install -r C:\AndroidStudioWorkspace\android-pololu-maestro-ssc-master\app\build\outputs\apk\app-debug.apk
Make sure your phone is accepting apps from unknown sources, in developer options.

How do I install an APK without any internet connection?

My phone's antenna died so it can't connect to the internet by cellular or wi-fi but I still want to use the phone for portable entertainment. I need a way to install an app strictly through the USB connection.
Unfortunately, every article I've looked at for how to install APKs without Google Play tells me to start by getting a file manager from Google Play.
You have two way can do that:
Note: you have to connect phone with PC througth USB cable before.
Copy any apk to phone from your PC/latop and open file browser in phone to open apk which you want to install
Use can use ADB command line tool:
Type command: adb install [apk_name_with_full_path]
Ex: adb install C:\your_package.apk
You can download APKs on your PC and install it using following command:
adb install -r [apk path]
Note: make sure that you have adb utility in your PC and in your phone developer options is switched on with USB Debugging enabled.
Enable USB Debugging

Geting APK file to work

I know to install apk file on emulator you type,
adb install [apk file name]
So, I followed and I have received this error,
antz#antz-90X3A:~/Android/androidmalware$ adb install 01_AngryBirdsRiov110.apk
error: device not found
- waiting for device -
when i checked android android virtual device, I have an device.
Do I have to something else to link?
Command for running emulator is:
emulator -avd <youravd.avd>
Sounds like you don't have an emulator or device connected to your computer. You can check if you have a device available by typing:
adb devices
Just because you created an AVD doesn't mean it is running. You need to start an emulator using the AVD you created.

Categories

Resources