Hi!
How I can start my test without apk-file on my pc?
I try set capabilities
private DesiredCapabilities setSessionParams(){
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("platformName",platformName);
dc.setCapability("deviceName", deviceName);
dc.setCapability("fullReset", false);
dc.setCapability("noReset", true);
dc.setCapability("appPackage", packageName); //com.example.app
dc.setCapability("appActivity", activityName); //.MainActivity or MainActivity
dc.setCapability("udid", udid);
dc.setCapability("platformVersion", platformVersion);
return dc;
}
public AndroidDriver loadApp(){
AndroidDriver driver = null;
try {
driver = new AndroidDriver(new URL("http://" + host + ":" + port + "/wd/hub"),
setSessionParams());
} catch (MalformedURLException e) {
e.printStackTrace();
}
return driver;
}
But in appium log i can see
[MJSONWP] Encountered internal error running command: Error: Cannot start the 'com.example.app' application. Original error: Activity name '.MainActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
[MJSONWP] at ADB.callee$0$0$ (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:125:11)
[MJSONWP] at tryCatch (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
If I add absolute path like
dc.setCapability("app", "absolute path");
to my capabilities I see in appium log
[MJSONWP] Encountered internal error running command: Error: Cannot start the 'com.example.app' application. Original error: Activity name '.MainActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
[MJSONWP] at ADB.callee$0$0$ (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:125:11)
[MJSONWP] at tryCatch (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (C:\Users\xxx\appium-desktop\app-1.6.2\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
If i delete appPackage & activity capability like
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("platformName",platformName);
dc.setCapability("deviceName", deviceName);
dc.setCapability("fullReset", false);
dc.setCapability("noReset", true);
dc.setCapability("udid", udid);
dc.setCapability("platformVersion", platformVersion);
dc.setCapability("app", appPath);
my test working.