Android application execution - android

I am executing an Android chat application on my Windows 7 PC (not using Eclipse). I created one emulator in AVD manager and installed that application using ADB.
I want to know how to run that application in two Android virtual devices simultaneously. Can anybody help?

type:
adb devices
you'll see for ex:
emulator-5555
emulator-5554
To install your app on each one:
adb -s emulator-5555 install yourapp.apk
adb -s emulator-5554 install yourapp.apk

Related

How to launch adb shell in Android Studio?

I am using Android Studio 2020.3.1.
I want to launch a adb shell from within Android Studio.
I have the Terminal tab at the very bottom of the IDE.
But I can only open "Local" terminals.
Any ideas where I can launch a "Remote" adb shell?
Within you local terminal, you can easily start an adb shell with the command adb shell
Locate adb if it's not already in your executable paths environment variable. The location largely dependent on the OS you use and where you install the Android SDK. In general it's in the ${ANDROID_SDK}/platform-tools/ directory.
Execute adb devices. This will list the connected adb capable devices. If you are not running any emulators and you only connect your phone then your phone would show up (if not then you may need to treat some permission steps depending on your operating system). Let's say the ID of your device is XYZ.
Execute adb -s XYZ shell and you'll be in a shell on your device.

ADB more than one device/emulator but there isn't

(master) $ adb -s emulator-5554 reverse tcp:8081 tcp:8081
error: more than one device/emulator
(master) $ adb devices -l
List of devices attached
emulator-5554 device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:2
Trying to deploy a react-native app to an emulated device. The build, gradle etc runs fine but when trying to connect to the emulator it shows an error more than one device/emulator despite there only being one device when running adb devices
Literally no idea how to solve this, Android Studio 3.1, emulated device is a Nexus 5x running Android 8. Have restarted, upgraded etc but still get this message.

APK is not installing in docker emulator

I am trying to install an apk file on my virtual adb resides in a docker container. Whenever I try to install the apk getting the response
Aborted
The devices listed for the adb device command are
List of devices attached
emulator-5554 device
I endup getting same error for the command adb -s emulator-5554 install apk_path. The same is working for some other container and don't have the faintest idea why it is happening so.

How do you connect your terminal with the Android emulator

I have tried the navigate to the android tool folder and entering the "adb shell" command but it doesn't seem to work. My terminal seems only to recognize the adb part of the command and gives me an error message. What am I doing wrong???
List all connected devices by typing adb devices
Check, if there are any devices listed. If not you may want to check that your device is connected and/or your emulator is running.
If it works and you have for example your emulator running and your usb-device connected use:
adb shell if you only have device connected.
adb -d shell to connect to an USB-Device.
adb -e shell to connect to an emulated device.
If you have more than one emulator or usb devices you might want to use:
adb -s <DEVICE> shell
Note:
Make sure that the path to the android-sdk is properly set-up in your environment. To quickcheck, fire up a shell and type adb version. If that command succeeds, you're set up. If not, add /path/to/android-sdk/tools and /path/to/android/platform-tools to your $PATH env variable. On windows the android sdk is typically located in C:\Users\<username>\AppData\Local\Android\sdk.

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