Hello guys, I just started with Appium, but I not able to start an session if a use the follow capabilities:
“noReset”: “true”,
“full-reset”: “false”
I using appium with node and if a using this capabilities in my script I revice a error, but if I run the same script on appium desktop it work. Why this happening?
Follow my script:
const wdio = require('webdriverio');
const opts = {
port: 4723,
desiredCapabilities: {
"platformName": "Android",
"platformVersion": "7.0",
"deviceName": "0023048519",
"appPackage": "io.appium.android.apis",
"appActivity": "io.appium.android.apis.ApiDemos",
"automationName": "UiAutomator2",
"noReset": "true",
"full-reset": "false"
}
};
const client = wdio.remote(opts);
client
.init()
.click("~App")
.click("~Alert Dialogs")
.back()
.back()
.end();
Now the log of the appium.
[Appium] Welcome to Appium v1.8.0 (REV 93990ab7da37007c8d9db16415cfb939aa5dd201)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"platformName":"Android","platformVersion":"7.0","deviceName":"0023048519","appPackage":"io.appium.android.apis","appActivity":"io.appium.android.apis.ApiDemos","automationName":"UiAutomator2","noReset":"true","full-reset":"false","requestOrigins":{"url":"http://webdriver.io","version":"4.12.0","name":"webdriverio"}}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"platformName":"Android","platformVersion":"7.0","deviceName":"0023048519","appPackage":"io.appium.android.apis","appActivity":"io.appium.android.apis.ApiDemos","automationName":"UiAutomator2","noReset":"true","full-reset":"false","requestOrigins":{"url":"http://webdriver.io","version":"4.12.0","name":"webdriverio"}},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1527111058364 (18:30:58 GMT-0300 (-03))
[Appium] Creating new AndroidUiautomator2Driver (v1.9.0) session
[Appium] Capabilities:
[Appium] javascriptEnabled: true
[Appium] locationContextEnabled: true
[Appium] handlesAlerts: true
[Appium] rotatable: true
[Appium] platformName: Android
[Appium] platformVersion: 7.0
[Appium] deviceName: 0023048519
[Appium] appPackage: io.appium.android.apis
[Appium] appActivity: io.appium.android.apis.ApiDemos
[Appium] automationName: UiAutomator2
[Appium] noReset: true
[Appium] full-reset: false
[Appium] requestOrigins: {
[Appium] url: http://webdriver.io
[Appium] version: 4.12.0
[Appium] name: webdriverio
[Appium] }
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"javascriptEnabled":true,"...
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by appium: javascriptEnabled, locationContextEnabled, handlesAlerts, rotatable, full-reset, requestOrigins.
[BaseDriver] Session created with session id: 1dcd10f0-d946-4267-b27a-53b4b0c03d74
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_171
[ADB] Checking whether adb is present
[ADB] Found 3 'build-tools' folders under '/home/afonso/Android/Sdk' (newest first):
[ADB] /home/afonso/Android/Sdk/build-tools/27.0.1
[ADB] /home/afonso/Android/Sdk/build-tools/26.0.2
[ADB] /home/afonso/Android/Sdk/build-tools/25.0.3
[ADB] Using adb from /home/afonso/Android/Sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Looking for a device with Android '7.0'
[debug] [ADB] Setting device id to 0023048519
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 7.0
[AndroidDriver] Using device: 0023048519
[ADB] Checking whether adb is present
[ADB] Using adb from /home/afonso/Android/Sdk/platform-tools/adb
[debug] [ADB] Setting device id to 0023048519
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 24
[debug] [ADB] Device API level: 24
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 7.0
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell wm size'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell wm density'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell getprop ro.product.model'
[debug] [ADB] Current device property 'ro.product.model': Moto G (4)
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell getprop ro.product.manufacturer'
[debug] [ADB] Current device property 'ro.product.manufacturer': motorola
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell am force-stop io.appium.uiautomator2.server'
[debug] [ADB] Checking app cert for /home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.7.0.apk
[ADB] Using apksigner from /home/afonso/Android/Sdk/build-tools/27.0.1/apksigner
[ADB] Using apksigner from /home/afonso/Android/Sdk/build-tools/27.0.1/apksigner
[debug] [ADB] Starting '/home/afonso/Android/Sdk/build-tools/27.0.1/apksigner' with args 'verify,--print-certs,/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.7.0.apk'
[debug] [ADB] '/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.7.0.apk' is already signed.
[debug] [ADB] Checking app cert for /home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
[ADB] Using apksigner from /home/afonso/Android/Sdk/build-tools/27.0.1/apksigner
[ADB] Using apksigner from /home/afonso/Android/Sdk/build-tools/27.0.1/apksigner
[debug] [ADB] Starting '/home/afonso/Android/Sdk/build-tools/27.0.1/apksigner' with args 'verify,--print-certs,/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk'
[debug] [ADB] '/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' is already signed.
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell pm list packages io.appium.uiautomator2.server'
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for 'io.appium.uiautomator2.server'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell dumpsys package io.appium.uiautomator2.server'
[ADB] Checking whether aapt is present
[ADB] Using aapt from /home/afonso/Android/Sdk/build-tools/27.0.1/aapt
[debug] [ADB] The installed 'io.appium.uiautomator2.server' package does not require upgrade ('1.7.0' >= '1.7.0')
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell pm list packages io.appium.uiautomator2.server.test'
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for 'io.appium.uiautomator2.server.test'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell dumpsys package io.appium.uiautomator2.server.test'
[ADB] Checking whether aapt is present
[ADB] Using aapt from /home/afonso/Android/Sdk/build-tools/27.0.1/aapt
[ADB] Cannot read version codes of '/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' and/or 'io.appium.uiautomator2.server.test'
[ADB] Cannot read version names of '/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' and/or 'io.appium.uiautomator2.server.test'. Assuming correct app version is already installed
[debug] [UiAutomator2] Waiting up to 20000ms for instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' to be available
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell pm list instrumentation'
[debug] [UiAutomator2] Instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' available
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 wait-for-device'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell pm list packages io.appium.settings'
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell dumpsys package io.appium.settings'
[ADB] Checking whether aapt is present
[ADB] Using aapt from /home/afonso/Android/Sdk/build-tools/27.0.1/aapt
[debug] [ADB] The installed 'io.appium.settings' package does not require upgrade ('2.3.0' >= '2.3.0')
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell ps'
[debug] [ADB] Device API level: 24
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[debug] [ADB] Device API level: 24
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell appops set io.appium.settings android\:mock_location allow'
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: 'null' and country: 'null'
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing unlock helper app to device...
[debug] [ADB] Getting install status for io.appium.unlock
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell pm list packages io.appium.unlock'
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for 'io.appium.unlock'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell dumpsys package io.appium.unlock'
[ADB] Checking whether aapt is present
[ADB] Using aapt from /home/afonso/Android/Sdk/build-tools/27.0.1/aapt
[debug] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 forward tcp\:8200 tcp\:6790'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell rm -rf /data/local/tmp/strings.json'
[debug] [UiAutomator2] No app capability. Assuming it is already on the device
[debug] [ADB] Checking app cert for null
[debug] [ADB] 'null' doesn't exist
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell am force-stop io.appium.uiautomator2.server'
[UiAutomator2] Starting uiautomator2 server 1.7.0
[UiAutomator2] Using UIAutomator2 server from '/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.7.0.apk' and test from '/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk'
[UiAutomator2] Running command: 'adb -s 0023048519 shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner'
[UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online...
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [UiAutomator2] [UIAutomator2] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner} from pid=8317, uid=8317 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[debug] [UiAutomator2] [UIAutomator2] at android.os.Parcel.readException(Parcel.java:1683)
[debug] [UiAutomator2] [UIAutomator2] at android.os.Parcel.readException(Parcel.java:1636)
[debug] [UiAutomator2] [UIAutomator2] at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:4610)
[debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Am.runInstrument(Am.java:893)
[debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Am.onRun(Am.java:402)
[debug] [UiAutomator2] [UIAutomator2] at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
[debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Am.main(Am.java:122)
[debug] [UiAutomator2] [UIAutomator2] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[debug] [UiAutomator2] [UIAutomator2] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)
[debug] [UiAutomator2] [UIAutomator2] INSTRUMENTATION_STATUS: id=ActivityManagerService
[debug] [UiAutomator2] [UIAutomator2] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner} from pid=8317, uid=8317 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server
[debug] [UiAutomator2] [UIAutomator2] INSTRUMENTATION_STATUS_CODE: -1
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Trying to proxy a session command without session id
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 shell am force-stop io.appium.android.apis'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running '/home/afonso/Android/Sdk/platform-tools/adb -P 5037 -s 0023048519 forward --remove tcp\:8200'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1527111091502 (18:31:31 GMT-0300 (-03))
[MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: read ECONNRESET
[MJSONWP] at JWProxy.proxy$ (/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:152:13)
[MJSONWP] at tryCatch (/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (/home/afonso/.nvm/versions/node/v9.11.1/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] at <anonymous>
[HTTP] <-- POST /wd/hub/session 500 33151 ms - 217
Note: I use the same script from the appium get started and the same app, I just don’t understand why I receive a error just for put two capabilities, looks like a bug to me.