I am trying to run a test file created on eclipse using appium. When I execute the test on a real android device connected to the system, I get the following error:
Enco
The issue speaks for itself: you either did not provide activity to recognise your app or you specified the wrong one.
What you can do:
adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
com.yourcompany.package/com.yourcompany.package.login.view.LoginActivity
So now you have package - com.yourcompany.package
and activity com.yourcompany.package.login.view.LoginActivity
that you should provide Appium.
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "device");
capabilities.setCapability("app", pathToApk);
capabilities.setCapability("platformName", "android");
capabilities.setCapability("appWaitPackage", "com.yourcompany.package");
capabilities.setCapability("appWaitActivity", "com.yourcompany.package.login.view.LoginActivity");
Works perfectly for me on multiple real devices