Failed to launch app instrumented for Android device

#1

Appium Studio 11.8.84
Android ver 8.0.0
Maven dependencies:
io.appium java-client 5.0.4
selenium (api, support) 3.10.0

During the execution test for Android device (not reproduced for IOS device) with capabilities:

    dc.setCapability("reportDirectory", reportDirectory);
    dc.setCapability("reportFormat", reportFormat);
    dc.setCapability("testName", testName);
    dc.setCapability(MobileCapabilityType.UDID, "009d6ffd000000");
    dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.android.chrome");
    dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "com.google.android.apps.chrome.Main");
    dc.setCapability("instrumentApp", true); //settings for Instrumented mode
    driver = new AndroidDriver<>(new URL("http://localhost:4723/wd/hub"), dc);

I get the next error in console log:

org.openqa.selenium.SessionNotCreatedException: session not created (An unknown server-side error occurred. 
status='false'. Failed to complete internal method: 'launch args: 
[com.android.chrome/com.google.android.apps.chrome.Main, true, true]', details: Failed to launch activity / URL. Failed 
to launch app instrumented. Launch Instrumentation failed. Please verify that the instrumented application is installed 
on the device (reportUrl=C:\Users\<user>\appiumstudioenterprise-reports\reports\test116))  (WARNING: The server did 
not provide any stacktrace information)

Command duration or timeout: 28.68 seconds
Build info: version: '3.10.0', revision: '176b4a9', time: '2018-03-02T19:03:16.397Z'
System info: host: 'hostName', ip: '10.10.10.10', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0',  
java.version: '1.8.0_171'
Driver info: driver.version: AndroidDriver

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:93)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72)

Any ideas why this may happens?
Note: is not reproduced for IOS device

0 Likes

#2

Questions:

  1. does the app launch with no instrumentation ?
  2. is the app obfuscated ? (for protection purposes)
0 Likes

#3

1.Yes, app is launching in with non-instrumented mode. But it is not an option for me.

dc.setCapability("instrumentApp", false);
  1. I’m not sure, but the app has some security limitation
0 Likes