Hello
I have created an emulator and launched it with AVD manager step in bitrise. When i try to run the appium scripts, i get an error [UIAutomator2] unable to force stop app.
then there is a time out error and the test doesnt run correctly.
error log :
Platform Name: Android
Platform Version: 7.1.1
Friendly Device Name: Pixel
STARTING APPIUM SERVER >>>>>>>>>>
APPIUM Server started
[Appium] Welcome to Appium v1.8.0
[Appium] Non-default server args:
[Appium] platformName: Android
[Appium] platformVersion: 7.1.1
[Appium] deviceName: Pixel
[Appium] app: /Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk
[Appium] noReset: true
[Appium] appWaitActivity: com.transurban.citylink.presentation.start.ConfigActivity
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities â{âplatformNameâ:âAndroidâ}â
[Appium] --platform-version => --default-capabilities â{âplatformVersionâ:â7.1.1â}â
[Appium] --device-name => --default-capabilities â{âdeviceNameâ:âPixelâ}â
[Appium] --app => --default-capabilities â{âappâ:"/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk"}â
[Appium] --no-reset => --default-capabilities â{ânoResetâ:true}â
[Appium] --app-wait-activity => --default-capabilities â{âappWaitActivityâ:âcom.transurban.citylink.presentation.start.ConfigActivityâ}â
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] platformName: Android
[Appium] platformVersion: 7.1.1
[Appium] deviceName: Pixel
[Appium] app: /Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk
[Appium] noReset: true
[Appium] appWaitActivity: com.transurban.citylink.presentation.start.ConfigActivity
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
@Logout
Feature: Logout
As a LINKT user
If i log out of the application
I want to have options to log back in quickly or log out completely
@LOUT002 @Ios @Android
Scenario Outline: As a LINKT user, I want to log out of Linkt completely # features/Logout.feature:9
Given The app is loaded for test ââ
And I login as User ââ and password ââ
And I click the Log in as a different user button
And I am at the safety acknowledgement screen
Examples:
[HTTP] --> POST /wd/hub/session
[HTTP] {âdesiredCapabilitiesâ:{âappâ:"/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk",âappWaitActivityâ:âcom.transurban.citylink.presentation.start.ConfigActivityâ,âautomationNameâ:âUiAutomator2â,âdeviceNameâ:âPixelâ,âisHeadlessâ:âtrueâ,âplatformNameâ:âAndroidâ,âplatformVersionâ:â7.1.1â,âsystemPortâ:â8250â},âcapabilitiesâ:{âdesiredCapabilitiesâ:{âappâ:"/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk",âappWaitActivityâ:âcom.transurban.citylink.presentation.start.ConfigActivityâ,âautomationNameâ:âUiAutomator2â,âdeviceNameâ:âPixelâ,âisHeadlessâ:âtrueâ,âplatformNameâ:âAndroidâ,âplatformVersionâ:â7.1.1â,âsystemPortâ:â8250â},âfirstMatchâ:[{âplatformNameâ:âandroidâ}]}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{âappâ:"/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk",âappWaitActivityâ:âcom.transurban.citylink.presentation.start.ConfigActivityâ,âautomationNameâ:âUiAutomator2â,âdeviceNameâ:âPixelâ,âisHeadlessâ:âtrueâ,âplatformNameâ:âAndroidâ,âplatformVersionâ:â7.1.1â,âsystemPortâ:â8250â},null,{âdesiredCapabilitiesâ:{âappâ:"/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk",âappWaitActivityâ:âcom.transurban.citylink.presentation.start.ConfigActivityâ,âautomationNameâ:âUiAutomator2â,âdeviceNameâ:âPixelâ,âisHeadlessâ:âtrueâ,âplatformNameâ:âAndroidâ,âplatformVersionâ:â7.1.1â,âsystemPortâ:â8250â},âfirstMatchâ:[{âplatformNameâ:âandroidâ}]}]
[debug] [BaseDriver] Event ânewSessionRequestedâ logged at 1525920995418 (19:56:35 GMT-0700 (PDT))
[BaseDriver] The capabilities [âplatformVersionâ,âdeviceNameâ,âappâ,ânoResetâ,âappWaitActivityâ] are not standard capabilities and should have an extension prefix
[Appium] Could not parse W3C capabilities: The arguments passed to the command are either invalid or malformed. Falling back to JSONWP protocol.
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: [âplatformNameâ,âplatformVersionâ,âdeviceNameâ,âappâ,ânoResetâ,âappWaitActivityâ,âautomationNameâ,âisHeadlessâ,âsystemPortâ]. Falling back to JSONWP protocol.
[Appium] Creating new AndroidUiautomator2Driver (v1.9.0) session
[Appium] Capabilities:
[Appium] platformName: Android
[Appium] platformVersion: 7.1.1
[Appium] deviceName: Pixel
[Appium] app: /Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk
[Appium] noReset: true
[Appium] appWaitActivity: com.transurban.citylink.presentation.start.ConfigActivity
[Appium] automationName: UiAutomator2
[Appium] isHeadless: true
[Appium] systemPort: 8250
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {âplatformNameâ:âAndroidâ,"âŚ
[BaseDriver] Capability âisHeadlessâ changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability âsystemPortâ changed from string (â8250â) to integer (8250). This may cause unexpected behavior
[BaseDriver] Session created with session id: f368357e-b94a-43d7-9e00-7b56bd6ea6c9
[BaseDriver] Using local app â/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apkâ
[debug] [UiAutomator2] Checking whether app is actually present
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_172
[ADB] Checking whether adb is present
[ADB] Found 17 âbuild-toolsâ folders under â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosxâ (newest first):
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/26.0.3
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/26.0.2
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.2
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.1
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/25.0.0
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/24.0.3
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/24.0.2
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/24.0.1
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/24.0.0
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/23.0.3
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/23.0.2
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/23.0.1
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/22.0.1
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/21.1.2
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/20.0.0
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/19.1.0
[ADB] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/17.0.0
[ADB] Using adb from /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/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.1.1â
[debug] [ADB] Setting device id to emulator-5554
[ADB] Getting device platform version
[debug] [ADB] Getting connected devicesâŚ
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.releaseâ
[debug] [ADB] Current device property âro.build.version.releaseâ: 7.1.1
[AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb
[debug] [ADB] Setting device id to emulator-5554
[debug] [ADB] Getting connected devicesâŚ
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.sdkâ
[debug] [ADB] Current device property âro.build.version.sdkâ: 25
[debug] [ADB] Device API level: 25
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Using apkanalyzer from /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools/bin/apkanalyzer
[debug] [ADB] Starting â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools/bin/apkanalyzerâ with args ["-h",âmanifestâ,âprintâ,"/Users/vagrant/git/LinktGOGroovy/APP-BRAND_1.5.2.564-QA_5002.apk"]
[ADB] Package name: âcom.transurban.linkt.sitâ
[ADB] Main activity name: âcom.transurban.citylink.presentation.start.ConfigActivityâ
[debug] [AndroidDriver] Parsed package and activity are: com.transurban.linkt.sit/com.transurban.citylink.presentation.start.ConfigActivity
[ADB] Getting device platform version
[debug] [ADB] Getting connected devicesâŚ
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.releaseâ
[debug] [ADB] Current device property âro.build.version.releaseâ: 7.1.1
[debug] [ADB] Getting connected devicesâŚ
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm sizeâ
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm sizeâ
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [ADB] Getting connected devicesâŚ
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.transurban.linkt.sitâ
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.transurban.linkt.sitâ
[UiAutomator2] Unable to force stop app: Error executing adbExec. Original error: âCommand â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.transurban.linkt.sitâ timed out after 20000msâ; Stderr: ââ; Code: ânullâ
[debug] [ADB] Removing forwarded port socket connection: 8250
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8250â
[debug] [ADB] Running â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8250â
[UiAutomator2] Unable to remove port forward âError executing adbExec. Original error: âCommand â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8250â exited with code 1â; Stderr: âerror: listener âtcp:8250â not foundâ; Code: â1ââ
[debug] [BaseDriver] Event ânewSessionStartedâ logged at 1525921084731 (19:58:04 GMT-0700 (PDT))
[W3C] Encountered internal error running command: Error: Error executing adbExec. Original error: âCommand â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm sizeâ exited with code 1â; Stderr: âError type 2
[W3C] android.util.AndroidException: Canât connect to window manager; is the system running?
[W3C] at com.android.commands.wm.Wm.onRun(Wm.java:82)
[W3C] at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
[W3C] at com.android.commands.wm.Wm.main(Wm.java:47)
[W3C] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[W3C] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)â; Code: â1â
[W3C] at ADB.execFunc$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:317:13)
[W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C] at
[HTTP] <-- POST /wd/hub/session 500 89386 ms - 2330
[HTTP]
Failure in before hook:env.groovy:22
Message: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: âCommand â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm sizeâ exited with code 1â; Stderr: âError type 2
android.util.AndroidException: Canât connect to window manager; is the system running?
at com.android.commands.wm.Wm.onRun(Wm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
at com.android.commands.wm.Wm.main(Wm.java:47)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)â; Code: â1â
Build info: version: â3.11.0â, revision: âe59cfb3â, time: â2018-03-11T20:26:55.152Zâ
System info: host: âcontrolosxprodc2bhostprebootedxamarin101.localâ, ip: âfe80:0:0:0:3b:8e85:81c8:cfe%en0â, os.name: âMac OS Xâ, os.arch: âx86_64â, os.version: â10.13.4â, java.version: â1.8.0_172â
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: âCommand â/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm sizeâ exited with code 1â; Stderr: âError type 2
android.util.AndroidException: Canât connect to window manager; is the system running?
at com.android.commands.wm.Wm.onRun(Wm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
at com.android.commands.wm.Wm.main(Wm.java:47)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)â; Code: â1â
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:800:13)
at asyncHandler$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:352:37)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at