Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to connect through my Android phone due to following error #14001

Closed
CrazyMunda opened this issue Feb 27, 2020 · 42 comments
Closed

Not able to connect through my Android phone due to following error #14001

CrazyMunda opened this issue Feb 27, 2020 · 42 comments

Comments

@CrazyMunda
Copy link

@CrazyMunda CrazyMunda commented Feb 27, 2020

The problem

I am trying to run few bdd test on my android Galaxy 8 device and while Appium is trying to establish a connection through my phone I am getting error

Environment

Appium version (1.13)
*Window 10
Node.js version (v13.9):
Mobile platform/version under test: Chrome(80.0.3987)
*android Galaxy 8

Details

[Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=10029, uid=10029 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] at android.os.Parcel.createException(Parcel.java:1966)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:1934)
[Instrumentation] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=10029, uid=10029 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] at android.os.Parcel.readException(Parcel.java:1884)
[Instrumentation] at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:4365)
[Instrumentation] at com.android.commands.am.Instrument.run(Instrument.java:484)
[Instrumentation] at com.android.commands.am.Am.runInstrument(Am.java:194)
[Instrumentation] at com.android.commands.am.Am.onRun(Am.java:80)
[Instrumentation] at com.android.internal.os.BaseCommand.run(BaseCommand.java:54)
[Instrumentation] at com.android.commands.am.Am.main(Am.java:50)
[Instrumentation] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[Instrumentation] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:341)
[Instrumentation] Caused by: android.os.RemoteException: Remote stack trace:
[Instrumentation] at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:26699)
[Instrumentation] at android.app.IActivityManager$Stub.onTransact$startInstrumentation$(IActivityManager.java:11161)
[Instrumentation] at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:440)
[Instrumentation] at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4140)
[Instrumentation] at android.os.Binder.execTransact(Binder.java:739)
[Instrumentation] INSTRUMENTATION_STATUS: id=ActivityManagerService
[Instrumentation] INSTRUMENTATION_STATUS_CODE: -1
[Instrumentation] The process has exited with code 1
[UiAutomator2] The instrumentation process has been unexpectedly terminated. Retrying UiAutomator2 startup (#1 of 1)
[UiAutomator2] Performing strict cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (Cannot read property 'map' of undefined)
[ADB] Running 'C:\Program Files\Android\SDK\platform-tools\adb.exe -P 5037 -s 988e16304351333151 shell am force-stop io.appium.uiautomator2.server.test'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting IDs of all 'uiautomator' processes
[ADB] Running 'C:\Program Files\Android\SDK\platform-tools\adb.exe -P 5037 -s 988e16304351333151 shell pgrep -f uiautomator'
[ADB] No 'uiautomator' process has been found
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","988e16304351333151","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[Instrumentation] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=10779, uid=10779 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] INSTRUMENTATION_STATUS: id=ActivityManagerService
[Instrumentation] INSTRUMENTATION_STATUS_CODE: -1
[Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=10779, uid=10779 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] at android.os.Parcel.createException(Parcel.java:1966)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:1934)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:1884)
[Instrumentation] at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:4365)
[Instrumentation] at com.android.commands.am.Instrument.run(Instrument.java:484)
[Instrumentation] at com.android.commands.am.Am.runInstrument(Am.java:194)
[Instrumentation] at com.android.commands.am.Am.onRun(Am.java:80)
[Instrumentation] at com.android.internal.os.BaseCommand.run(BaseCommand.java:54)
[Instrumentation] at com.android.commands.am.Am.main(Am.java:50)
[Instrumentation] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[Instrumentation] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:341)
[Instrumentation] Caused by: android.os.RemoteException: Remote stack trace:
[Instrumentation] at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:26699)
[Instrumentation] at android.app.IActivityManager$Stub.onTransact$startInstrumentation$(IActivityManager.java:11161)
[Instrumentation] at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:440)
[Instrumentation] at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4140)
[Instrumentation] at android.os.Binder.execTransact(Binder.java:739)
[Instrumentation] The process has exited with code 1
[UiAutomator2] Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
[UiAutomator2] at Object.wrappedLogger.errorAndThrow (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:78:13)
[UiAutomator2] at UiAutomator2Server.errorAndThrow [as startSession] (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\Appium

I did tried

adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test

Thankyou

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Feb 28, 2020

Please attach the full log. It looks like apk signing fails on the machine

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Feb 28, 2020

Also use the most recent Appium server version (preferably appium@beta)

@CrazyMunda

This comment has been minimized.

Copy link
Author

@CrazyMunda CrazyMunda commented Feb 28, 2020

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Feb 28, 2020

[info] �[35m[Appium]�[39m Welcome to Appium v1.13.0

I don't observe that Appium server got upgraded

@CrazyMunda

This comment has been minimized.

Copy link
Author

@CrazyMunda CrazyMunda commented Feb 28, 2020

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Feb 28, 2020

Try to delete the UIAutomator2 server binaries manually from the device under test and enable the noSign capability

@CrazyMunda

This comment has been minimized.

Copy link
Author

@CrazyMunda CrazyMunda commented Feb 28, 2020

Tried deleting and setting noSign to true but it didn't helped and I was reading one article which says "noSign | Skip checking and signing of app with debug keys, will work only with UiAutomator, default false" and i am using Android 9 where we need to use UiAotomator2.

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Feb 28, 2020

I don't have any more good ideas on that. It looks like an issue with signing, but I cannot say why exactly it does not work on your machine and does work for everyone else. Try to ask the people who were experiencing similar issues: https://github.com/appium/appium/issues?utf8=✓&q=is%3Aissue+%22signature+matching+the+target%22+is%3Aclosed+

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Feb 28, 2020

You could also try Espresso automation backend if nothing else helps

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 1, 2020

@mykola-mokhnach this happens to me too on a new machine.

The most obvious thing I can think of that is different is that new machine has an AMD Ryzen and I am using the new AMD Hypervisior, though I would not know why this would matter to signing https://androidstudio.googleblog.com/2019/12/emulator-29211-and-amd-hypervisor-12-to.html

Otherwise, I tried 1.16.0 and 1.15.1 , deleted all temp files, uninstalled packages, killed adb processes, recreated images etc... nothing seems to make it work .

Will try some more things and post here if I find anything

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 1, 2020

@bogdancucosel
You could try to set the remoteAppsCacheLimit cap to zero. Just to be sure the fresh server image is always used.
There is also a possibility to sign server apks manually, install them on the destination phone and set the skipServerInstallation cap to true. This will prevent Appium to perform any changes on the binaries and will work as expected (and will even speed up the session init) until it would be necessary to upgrade the server version. Upon each upgrade you have to repeat the above operation manually.

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 1, 2020

Ok, I tried remoteAppsCacheLimit to 0, but no change.

Not sure how to sign the server apks.
I tried something like:

C:\Users\bogdan\AppData\Local\Android\Sdk\build-tools\29.0.3\apksigner.bat sign --key C:\Users\bogdan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8" --cert "C:\Users\bogdan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem" "C:\Temp\appium-uiautomator2-server-debug-androidTest.apk"

C:\Users\bogdan\AppData\Local\Android\Sdk\build-tools\29.0.3\apksigner.bat sign --key C:\Users\bogdan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8" --cert "C:\Users\bogdan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem" "C:\Temp\appium-uiautomator2-server-v4.3.0.apk"

But I get the same error.
Can you please point me to how I should do that , because I cannot seem to find any info on this.

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 1, 2020

try to get raw files from fresh uiautomator2-server installation first. If these don't work then try to sign the apks on non-Windows machine. Btw, Android SDK has recently been upgraded to support Java9+ (build tools v. 30+), so make sure you don't run Java 8 on your machine.

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 2, 2020

it seems I have somehow broken my Android SDK install.
apksigner.bat uses a tools\lib\find_java.bat.
I am missing the tools folder.
I reinstalled the SDK but still did not appear.
I downloaded from https://developer.android.com/studio/index.html the command line tools, found the tools folder, but the find_java.bat is not in the lib folder.
I think I will start all over again from scratch :).
Thank you very much, I will post back

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 5, 2020

I would try to install the most recent Appium version via NPM, preferably appium@beta

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 5, 2020

I have noticed this issue as well.
I've attempted setup on two physical computers to no luck.
This was trying multiple versions of appium (1.16.0, 1.17.0-beta.1, and 1.12.0) and even the latest version of appium desktop (1.15.1)
Emulators that have been attempted through Android Studio v 3.6.1 include the Nexus 6P, Pixel 2, and Pixel 3 attempted on Android versions 7.1.1, 8.0, and 10.0.
All of these tries has resulted in the same signage error message:
[debug] [Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=5751, uid=5751 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server

For the frameworks I have used to communicate to appium, one of them is a custom C# dotnet core application but more importantly, the node example used here https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md#running-your-first-test

@CrazyMunda

This comment has been minimized.

Copy link
Author

@CrazyMunda CrazyMunda commented Mar 5, 2020

Try using uiautomator1 , hopefully it will solve your issue.

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 5, 2020

@csplugins It would be interesting to see the log from appium@beta
also consider checking #14001 (comment)

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 5, 2020

I tried that too and still the same issue. I even tried signing manually just like @bogdancucosel did.
But manually signing doesn't appear to do anything.
#14001 (comment)

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 5, 2020

Something makes me thinking this might be some Windows-specific SDK issue. What apksigner.bat verify --print-certs <apk_path> says if you run it on these two files?

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 5, 2020

If this is really an SDK issue then the solution might be to install an older SDK and set the buildToolsVersion capability to the appropriate build tools version number

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 5, 2020

Here is appium@beta logs. https://gist.github.com/csplugins/8717142f69fd93ca919625be09073ac8
Running the apksigner verify command had no output

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 5, 2020

I installed an older SDK build tool (25.0.3) and it seems to be working for me.
The version that did not work was 29.0.3.

If you want, I can also try the versions in between to figure out when the SDKs appear to be working.

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 5, 2020

Could you please report the issue to Google?

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 5, 2020

Actually, SDK seemed to be fine. What really fixed the issue for me was running the apksigner command you had posted above. Although it looked like nothing happened, it was the real fix.

For anyone else with the issue it seems the solution is to run the following:

C:\Users\you\AppData\Local\Android\Sdk\build-tools\29.0.3\apksigner.bat verify --print-certs C:\Users\you\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk

If you are using appium desktop, the location of that apk by default should be:

C:\Users\you\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 5, 2020

I actually gave up on trying to understand what's up with the missing folder.
I tried installing and again, but still nothing/
I copied the tools folder from an install on another computer and it works now.
Just out of curiosity , @csplugins in the sdk path C:\Users\you\AppData\Local\Android\Sdk, do you have a "tools" folder ?

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 5, 2020

@bogdancucosel, nope. I looked into why it's missing but got no where with it either.

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 5, 2020

:) @csplugins I must be very tired :)

The first thing that apksigner does is to look for find_java.bat, right ?

set java_exe=
if exist    "%~dp0..\tools\lib\find_java.bat" call    "%~dp0..\tools\lib\find_java.bat"
if exist "%~dp0..\..\tools\lib\find_java.bat" call "%~dp0..\..\tools\lib\find_java.bat"
if not defined java_exe goto :EOF

I mean, if the tools folder does not exist, then java_exe would presumably not be defined, and it apksigner would exit, and actually, if I remove the tools folder it would exit.

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 6, 2020

@bogdancucosel Sorry for the delayed response but your comment made sense and I wanted to double check how I got my instance working. Turns out you are correct. The apksigner.bat does not do anything and will immediately exit.

Actual steps to fix:

  • Uninstall all four apps from the device (or just make a new device through AVD). This can either be done manually or by running the command C:\Users\you\AppData\Local\Android\Sdk\platform-tools\adb.exe uninstall packageName where packageName is:
    • io.appium.uiautomator2.server
    • io.appium.uiautomator2.server.test
    • io.appium.android.apis
    • The app under test. (If you don't know this package name, execute adb shell pm list packages to find it)
  • Make sure you have a fresh copy of Appium (I am using version 1.16.0)
    • npm uninstall -g appium
    • npm install -g appium
  • Under Android Studio we need another SDK build tool other than the latest of 29.0.3
    • Open the SDK Manager and go to the tab labeled SDK Tools
    • In the bottom right, check the checkbox that reads Show Package Details
    • Select 29.0.2 and then press okay. They will ask you to confirm you want to install it
  • You should now see two versions under C:\Users\you\AppData\Local\Android\Sdk\build-tools
  • Move version 29.0.3 to a temporary location
    • I used C:\Users\you\AppData\Local\Android\Sdk\build-tools-temp
    • This will default the first run to use 29.0.2
  • Execute UIAutomator2 and you should get the error we have been seeing (no surprise)
  • Uninstall io.appium.uiautomator2.server.test from the device
    • Either manually or with C:\Users\you\AppData\Local\Android\Sdk\platform-tools\adb.exe uninstall io.appium.uiautomator2.server.test
  • Swap 29.0.3 and 29.0.2 so that 29.0.3 is in the real build-tools folder
  • Execute UIAutomator2 and you should get a new error along the lines of Encountered internal error running command: Error: Could not find 'zipalign.exe'
  • This is fine, just execute UIAutomator2 a third time and suddenly it all works.

I hope this solves your issue and anyone else experiencing it. I'm not sure who this issue belongs to at the end of the day.

P.S. This would also work if you swapped the order of the two SDKs above. (Start with 29.0.3 and swap it out for 29.0.2)

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 6, 2020

@csplugins Thanks for the detailed tutorial. I just want to add that it could be slightly simplified by setting buildToolsVersion to an older SDK version number. This way you don't have to replace any SDKs manually and can still keep multiple versions of them on the same machine.

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 6, 2020

Also it is still confusing that the corrupted apksigner script did not return an erroneous code, but a success instead, so Appium thinks everything is fine and there is no need to do a fallback. Like it was mentioned above, try to describe the issue to Google, so other people don't face the same thing in the future SDK releases

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 6, 2020

@csplugins thank you very much .
@mykola-mokhnach So the conclusion is that it seems to be something wrong with the 29.0.3 build tools, and I will raise an issue to google.
But I am still confused, as far as appium is concerned ,signing the apks is required ? (I mean calling the apksigner.bat, that actually does nothing no matter if the build tools are new or old)

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 6, 2020

But I am still confused, as far as appium is concerned ,signing the apks is required ? (I mean calling the apksigner.bat, that actually does nothing no matter if the build tools are new or old)

All was fine from the server side. Although apksigner was returning exit code zero even though it was not working. This made the server think the signing succeeded even though it did not. I would expect the tool to return an error code if something is wrong with it.

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 6, 2020

I get it now , thank you very much.

I just realized what happens.
The "tools" folder is actually the component called "Android SDK Tools" (as opposed to "Android SDk Platform-Tools" and "Android SDK Command-Line tools").

On my home PC, you know the Ryzen one, I did not realized I did not have the "Android SDK Tools" entry in the SDK manager.

Now, on my work computer, I saw the entry. I was curious and uncheked it; as expected, the tools folder dissapeared.

The funny part is that it does not show anymore, so I cannot install it again :)

I will file a bug on the google side, as soon as I understand what is the correct issue tracker .

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 6, 2020

@bogdancucosel

This comment has been minimized.

Copy link

@bogdancucosel bogdancucosel commented Mar 6, 2020

Filed the issue , hopefully on the correct tracker.

@csplugins

This comment has been minimized.

Copy link

@csplugins csplugins commented Mar 6, 2020

@bogdancucosel Good call on installing the "obsolete" Android SDK Tools. That solves the mystery of the missing tools folder. Sound like they have a couple options for the permanent fix here. Could be making the batch file fail if the java executable is not found or Somehow re-enabling the obsolete tool so that the tools path exists. Either way, it sounds like this issue can be closed now.

@mykola-mokhnach

This comment has been minimized.

Copy link
Collaborator

@mykola-mokhnach mykola-mokhnach commented Mar 15, 2020

Since Appium 1.17 the batch wrapper is not used anymore, but directly the signer jar script. This means the error handling should work better now.

@prsharma21

This comment has been minimized.

Copy link

@prsharma21 prsharma21 commented Mar 15, 2020

I am having same problem tried
adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test
but nothing working. Is there a solution??

@Avinashkumar245

This comment has been minimized.

Copy link

@Avinashkumar245 Avinashkumar245 commented Mar 28, 2020

[Appium] Welcome to Appium v1.15.1
[Appium] Non-default server args:
[Appium] allowInsecure: {
[Appium] }
[Appium] denyInsecure: {
[Appium] }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/sessions
[HTTP] {}
[GENERIC] Calling AppiumDriver.getSessions() with args: []
[GENERIC] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /wd/hub/sessions 200 11 ms - 40
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"appActivity":"com.xlythe.calculator.material.Theme.Orange","appPackage":"com.android2.calculator3","automationName":"UiAutomator2","deviceName":"emulator-5554","platformName":"android","newCommandTimeout":0,"connectHardwareKeyboard":true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.xlythe.calculator.material.Theme.Orange","appPackage":"com.android2.calculator3","automationName":"UiAutomator2","deviceName":"emulator-5554","platformName":"android","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1585422239171 (00:33:59 GMT+0530 (India Standard Time))
[Appium] Appium v1.15.1 creating new AndroidUiautomator2Driver (v1.37.2) session
[BaseDriver] Creating session with MJSONWP desired capabilities: {
[BaseDriver] "appActivity": "com.xlythe.calculator.material.Theme.Orange",
[BaseDriver] "appPackage": "com.android2.calculator3",
[BaseDriver] "automationName": "UiAutomator2",
[BaseDriver] "deviceName": "emulator-5554",
[BaseDriver] "platformName": "android",
[BaseDriver] "newCommandTimeout": 0,
[BaseDriver] "connectHardwareKeyboard": true
[BaseDriver] }
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver] connectHardwareKeyboard
[BaseDriver] Session created with session id: ec1e84f6-d39e-4ce2-8b37-283cb6712de8
[UiAutomator2] Starting 'com.android2.calculator3' directly on the device
[ADB] Found 1 'build-tools' folders under 'C:\Users\z003sxph\AppData\Local\Android\Sdk' (newest first):
[ADB] C:/Users/z003sxph/AppData/Local/Android/Sdk/build-tools/30.0.0-rc2
[ADB] Using 'adb.exe' from 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[ADB] Setting device id to emulator-5554
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[ADB] Current device property 'ro.build.version.sdk': 29
[ADB] Device API level: 29
[UiAutomator2] Relaxing hidden api policy
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put global hidden_api_policy_pre_p_apps 1'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put global hidden_api_policy_p_apps 1'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put global hidden_api_policy 1'
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] 'io.appium.settings' is installed
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\emulator\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\tools\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'C:\Users\z003sxph\AppData\Local\Android\Sdk'?
[ADB] Using 'aapt.exe' from 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\aapt.exe'
[ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.14.2' >= '2.14.2')
[ADB] There is no need to install/upgrade 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f io\.appium\.settings'
[AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell appops set io.appium.settings android:mock_location allow'
[Logcat] Starting logcat capture
[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[ADB] 'io.appium.uiautomator2.server' is installed
[ADB] Getting package info for 'io.appium.uiautomator2.server'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\emulator\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\tools\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat","C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'C:\Users\z003sxph\AppData\Local\Android\Sdk'?
[ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.3.0' >= '4.3.0')
[UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[ADB] Checking app cert for C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk
[ADB] Using 'apksigner.bat' from 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apksigner.bat'
[ADB] Starting 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apksigner.bat' with args '["verify","--print-certs","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk"]'
[ADB] 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is signed with non-default certificate
[ADB] Using 'zipalign.exe' from 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\zipalign.exe'
[ADB] C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already zip-aligned. Doing nothing
[ADB] Signing 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' with default cert
[ADB] Starting 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apksigner.bat' with args '["sign","--key","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8","--cert","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk"]'
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[ADB] 'io.appium.uiautomator2.server.test' is installed
[ADB] Checking app cert for C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[ADB] Starting 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apksigner.bat' with args '["verify","--print-certs","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk"]'
[ADB] 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is signed with non-default certificate
[ADB] C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already zip-aligned. Doing nothing
[ADB] Signing 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' with default cert
[ADB] Starting 'C:\Users\z003sxph\AppData\Local\Android\Sdk\build-tools\30.0.0-rc2\apksigner.bat' with args '["sign","--key","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8","--cert","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem","C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk"]'
[UiAutomator2] Server packages are going to be (re)installed
[UiAutomator2] Full packages reinstall is going to be performed
[ADB] Uninstalling io.appium.uiautomator2.server
[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[ADB] 'io.appium.uiautomator2.server' is installed
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 uninstall io.appium.uiautomator2.server'
[ADB] 'adb uninstall io.appium.uiautomator2.server' command output: Success
[ADB] io.appium.uiautomator2.server was successfully uninstalled
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo ERROR''
[ADB] The count of applications in the cache: 3
[ADB] The application at 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already cached to '/data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk'
[ADB] The installation of 'appium-uiautomator2-server-v4.3.0.apk' took 1.169s
[ADB] Install command stdout: Success
[ADB] Uninstalling io.appium.uiautomator2.server.test
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[ADB] 'io.appium.uiautomator2.server.test' is installed
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 uninstall io.appium.uiautomator2.server.test'
[ADB] 'adb uninstall io.appium.uiautomator2.server.test' command output: Success
[ADB] io.appium.uiautomator2.server.test was successfully uninstalled
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo ERROR''
[ADB] The count of applications in the cache: 3
[ADB] The application at 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already cached to '/data/local/tmp/appium_cache/0beede6c27af5c71c23a0d9d1c82a7a0b18390e0.apk'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0beede6c27af5c71c23a0d9d1c82a7a0b18390e0.apk'
[ADB] The installation of 'appium-uiautomator2-server-debug-androidTest.apk' took 1.751s
[ADB] Install command stdout: Success
[UiAutomator2] Waiting up to 30000ms for services to be available
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation'
[UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[ADB] Forwarding system: 8200 to device: 6790
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790'
[UiAutomator2] No app capability. Assuming it is already on the device
[ADB] Getting install status for com.android2.calculator3
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.android2.calculator3'
[ADB] 'com.android2.calculator3' is installed
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.android2.calculator3'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm clear com.android2.calculator3'
[AndroidDriver] Performed fast reset on the installed 'com.android2.calculator3' application (stop and clear)
[UiAutomator2] Performing shallow cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (Error: socket hang up)
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[UiAutomator2] Starting UIAutomator2 server 4.3.0
[UiAutomator2] Using UIAutomator2 server from 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' and test from 'C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk'
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=21360, uid=21360 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] at android.os.Parcel.createExceptionOrNull(Parcel.java:2285)
[Instrumentation] at android.os.Parcel.createException(Parcel.java:2269)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:2252)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:2194)
[Instrumentation] at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:6124)
[Instrumentation] at com.android.commands.am.Instrument.run(Instrument.java:517)
[Instrumentation] at com.android.commands.am.Am.runInstrument(Am.java:202)
[Instrumentation] at com.android.commands.am.Am.onRun(Am.java:80)
[Instrumentation] at com.android.internal.os.BaseCommand.run(BaseCommand.java:60)
[Instrumentation] at com.android.commands.am.Am.main(Am.java:50)
[Instrumentation] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[Instrumentation] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:396)
[Instrumentation] Caused by: android.os.RemoteException: Remote stack trace:
[Instrumentation] at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:16578)
[Instrumentation] at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2654)
[Instrumentation] at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2783)
[Instrumentation] at android.os.Binder.execTransactInternal(Binder.java:1138)
[Instrumentation] at android.os.Binder.execTransact(Binder.java:1102)
[Instrumentation] The process has exited with code 1
[UiAutomator2] The instrumentation process has been unexpectedly terminated. Retrying UiAutomator2 startup (#1 of 1)
[UiAutomator2] Performing strict cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (Error: socket hang up)
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting IDs of all 'uiautomator' processes
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f uiautomator'
[ADB] No 'uiautomator' process has been found
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=21390, uid=21390 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] at android.os.Parcel.createExceptionOrNull(Parcel.java:2285)
[Instrumentation] at android.os.Parcel.createException(Parcel.java:2269)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:2252)
[Instrumentation] at android.os.Parcel.readException(Parcel.java:2194)
[Instrumentation] at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:6124)
[Instrumentation] at com.android.commands.am.Instrument.run(Instrument.java:517)
[Instrumentation] at com.android.commands.am.Am.runInstrument(Am.java:202)
[Instrumentation] at com.android.commands.am.Am.onRun(Am.java:80)
[Instrumentation] at com.android.internal.os.BaseCommand.run(BaseCommand.java:60)
[Instrumentation] at com.android.commands.am.Am.main(Am.java:50)
[Instrumentation] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[Instrumentation] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:396)
[Instrumentation] Caused by: android.os.RemoteException: Remote stack trace:
[Instrumentation] at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:16578)
[Instrumentation] at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2654)
[Instrumentation] at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2783)
[Instrumentation] at android.os.Binder.execTransactInternal(Binder.java:1138)
[Instrumentation] at android.os.Binder.execTransact(Binder.java:1102)
[Instrumentation] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=21390, uid=21390 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[Instrumentation] INSTRUMENTATION_STATUS: id=ActivityManagerService
[Instrumentation] INSTRUMENTATION_STATUS_CODE: -1
[Instrumentation] The process has exited with code 1
[UiAutomator2] Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
[UiAutomator2] at Object.wrappedLogger.errorAndThrow (C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:79:13)
[UiAutomator2] at UiAutomator2Server.errorAndThrow [as startSession] (C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:227:13)
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[WD Proxy] Matched '/' to command name 'deleteSession'
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.android2.calculator3'
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8200
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200'
[UiAutomator2] Restoring hidden api policy to the device default configuration
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_p_apps'
[ADB] Running 'C:\Users\z003sxph\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy'
[BaseDriver] Event 'newSessionStarted' logged at 1585422253971 (00:34:13 GMT+0530 (India Standard Time))
[MJSONWP] Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
[MJSONWP] at Object.wrappedLogger.errorAndThrow (C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:79:13)
[MJSONWP] at UiAutomator2Server.errorAndThrow [as startSession] (C:\Users\z003sxph\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:227:13)
[HTTP] <-- POST /wd/hub/session 500 14802 ms - 274
[HTTP]
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 3 ms - 57
[HTTP]

Facing same issue anyone having any solution? I tried all the possible solution mentioned above still I am getting same error.

@wazetrek

This comment has been minimized.

Copy link

@wazetrek wazetrek commented Mar 30, 2020

it worked for me in the following way after trying to use many capabilities, these were the only ones
{
"platformName": "Android",
"appPackage": "com.android.calculator2",
"appActivity": "com.android.calculator2.Calculator",
"udid": "emulator-5554",
"deviceName": "Emulador",
"automationName": "UiAutomator1"
}

@pavang24

This comment has been minimized.

Copy link

@pavang24 pavang24 commented Apr 2, 2020

@wazetrek Thanks, worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.