How to install .apk file using adb on nixos? - android

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.

Related

Error installing (arcore-preview.apk) via USB/debugging mode on an Android Smartphone

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."

adb fail install .apk

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

ADB will not run

I just installed the android SDK with eclipse, straight from google's webpage, but for some reason it won't run, even when I am in the correct directory. When I use 'ls' (crunchbang linux) it show's that the file is there, but when I try to run it, it returns no such file or directory. Any ideas?
type script in your command if you adb configured.
adb stop-server
adb start-server
adb devices

Can't install apk via adb, file DNE despite showing up using adb shell ls

I uploaded an apk using adb
adb push myAppName.apk /sdcard/
to double check:
adb shell ls /sdcard/
sure enough, it's there.
then:
adb install /sdcard/myAppName.apk
can't find '/sdcard/myAppName.apk' to install
Note* I tried adding the path in parentheses as suggested on an xda post but this didn't help.
Are there multiple sdcard directories where push defaults to one and install defaults to another? I tried using root explorer to find the files that adb install /sdcard/<TAB> suggests but I can't file these files in any dir.
adb install takes a file on your pc to install it. It doesn't look on the phone.
You can use:
adb shell pm install /mnt/sdcard/myAppName.apk
It will install apk from the device it self.
Please check Package Manager here.
Connect your device and the from the location where you have your app.apk do adb install app.apk . It will install it to your device.

How to run Android instrumentation tests from the command line (in Kubuntu)?

We are able to run instrumentation tests of Android from the command line on Windows by launching:
adb shell
am instrument -w <package.test>/android.test.InstrumentationTestRunner
This gives us good results.
Using the same architecture, we are unable to run the same in Kubuntu.
We have the same setup in Kubuntu.
Can someone let us know, if there are packages with same name.. Then what package will the adb shell point?
How will the emulator connect with adb shell from cmd line?
DO we need to do any changes to do so in Kubuntu ?
You need to explain what errors you are seeing.
If you have the same setup under Kubuntu, i.e. the Android SDK is installed, with tools like adb accessible in your path, then everything should work fine.
In response to your individual points (and these answers are the same on Windows, Mac or Linux):
It is not possible to have more than one Android package installed on a device or emulator with the same package name.
You can connect to the emulator — the same as for any device — by calling adb shell, e.g.:
adb -d shell if you have a single USB-attached device
adb -e shell if you have a single emulator running
adb -s emulator-5554 shell to specify a particular emulator (or device serial number)
You don't need to change anything between operating systems. The difference would be with setting up a device, as you need to modify udev rules on Linux, and install the USB driver on Windows

Categories

Resources