Can anyone help in how to install .apk file in the android device/emulator programmatically?
I have tried the below methods:
UiDevice mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
mDevice.executeShellCommand("adb shell pm install -t -r /data/local/tmp/com.example.xxxxx.xxxxxx");
But it is not working.
I am using UIAutomator for android native app automation testing, I need to install .apk file into android device/emulator before proceeding with my test scripts execution.