KK.
KK.

Reputation: 4197

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.

  1. Can someone let us know, if there are packages with same name.. Then what package will the adb shell point?
  2. How will the emulator connect with adb shell from cmd line?
  3. DO we need to do any changes to do so in Kubuntu ?

Upvotes: 2

Views: 6334

Answers (1)

Christopher Orr
Christopher Orr

Reputation: 111623

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):

  1. It is not possible to have more than one Android package installed on a device or emulator with the same package name.

  2. 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)
  3. 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

Upvotes: 3

Related Questions