headspinio / appium-tizen-tv-driver

A Samsung Tizen TV driver for Appium
Apache License 2.0
10 stars 2 forks source link

sdb shell 0 debug fails on TizenTV 2017 #584

Closed Jiyvn closed 2 months ago

Jiyvn commented 4 months ago

Problem

command sdb shell 0 debug works on Tizen 5.5 (TizenTV 2020) but fails for Tizen 3.0 (TizenTV 2017) with same wgt 2020

image

2017

image

sdb capability

image

the install/uninstall command is fine. Is it possible to skip debug command

appium server log

[AppiumDriver@60fb] Appium v2.5.1 creating new TizenTVDriver (v0.10.0) session [AppiumDriver@60fb] Checking BaseDriver versions for Appium and TizenTVDriver [AppiumDriver@60fb] Appium's BaseDriver version is 9.5.2 [AppiumDriver@60fb] TizenTVDriver's BaseDriver version is 8.7.3 [AppiumDriver@60fb] Explicitly enabling use of insecure features: [AppiumDriver@60fb] chromedriver_autodownload [TizenTVDriver@e01f] Creating session with W3C capabilities: { [TizenTVDriver@e01f] "alwaysMatch": { [TizenTVDriver@e01f] "platformName": "TizenTV", [TizenTVDriver@e01f] "appium:deviceAddress": "192.168.10.181:26101", [TizenTVDriver@e01f] "appium:udid": "192.168.10.181:26101", [TizenTVDriver@e01f] "appium:automationName": "TizenTV", [TizenTVDriver@e01f] "appium:rcMode": "remote", [TizenTVDriver@e01f] "appium:chromedriverExecutableDir": "/Users/jiyvn/aviu/apps/tv/chromedriver/", [TizenTVDriver@e01f] "appium:appPackage": "TXSXgdzhCp.Viu", [TizenTVDriver@e01f] "appium:deviceName": "Tizen3.0 2020", [TizenTVDriver@e01f] "appium:noReset": false, [TizenTVDriver@e01f] "appium:app": "/Users/jiyvn/aviu/apps/Viu_dev.wgt", [TizenTVDriver@e01f] "appium:rcToken": "15773870" [TizenTVDriver@e01f] }, [TizenTVDriver@e01f] "firstMatch": [ [TizenTVDriver@e01f] {} [TizenTVDriver@e01f] ] [TizenTVDriver@e01f] } [TizenTVDriver@e01f (012ab4c6)] Session created with session id: 012ab4c6-e55d-43d7-b6fe-ddd7de58928f [TizenTVDriver] Received rcKeypressCooldown of type undefined [TizenTVDriver] Uninstalling tizen app 'TXSXgdzhCp.Viu' on device '192.168.10.181:26101' [TizenTVDriver] Running command: /Users/jiyvn/tizen-studio/tools/ide/bin/tizen uninstall -p TXSXgdzhCp.Viu -s 192.168.10.181:26101 [TizenTVDriver] Installing tizen app '/Users/jiyvn/aviu/apps/Viu_dev.wgt' on device '192.168.10.181:26101' [TizenTVDriver] Running command: /Users/jiyvn/tizen-studio/tools/ide/bin/tizen install -n /Users/jiyvn/aviu/apps/Viu_dev.wgt -s 192.168.10.181:26101 [TizenTVDriver] Listing apps installed on '192.168.10.181:26101' [TizenTVDriver] Running command: /Users/jiyvn/tizen-studio/tools/sdb -s 192.168.10.181:26101 shell 0 applist [TizenTVDriver] There are 152 apps installed [TizenTVDriver] Starting TXSXgdzhCp.Viu in debug mode on 192.168.10.181:26101 [TizenTVDriver] Running command: /Users/jiyvn/tizen-studio/tools/sdb -s 192.168.10.181:26101 shell 0 debug TXSXgdzhCp.Viu [TizenTVDriver] Cleaning up any ports which have been forwarded [AppiumDriver@60fb] Event 'newSessionStarted' logged at 1710915243869 (14:14:03 GMT+0800 (China Standard Time)) [AppiumDriver@60fb] Encountered internal error running command: Command '/Users/jiyvn/tizen-studio/tools/sdb -s 192.168.10.181\:26101 shell 0 debug TXSXgdzhCp.Viu' exited with code 1. Stdout was: ''. Stderr was: 'closed ' [AppiumDriver@60fb] Error: Command '/Users/jiyvn/tizen-studio/tools/sdb -s 192.168.10.181\:26101 shell 0 debug TXSXgdzhCp.Viu' exited with code 1 [AppiumDriver@60fb] at ChildProcess. (/Users/jiyvn/.appium/node_modules/appium-tizen-tv-driver/node_modules/teen_process/lib/exec.js:128:19) [AppiumDriver@60fb] at ChildProcess.emit (node:events:518:28) [AppiumDriver@60fb] at maybeClose (node:internal/child_process:1105:16) [AppiumDriver@60fb] at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5) [HTTP] <-- POST /session 500 15122 ms - 876 [HTTP] 

the app should be debuggable as using the same wgt https://github.com/headspinio/appium-tizen-tv-driver/blob/main/packages/appium-tizen-tv-driver/README.md#troubleshooting

A similar issue was reported before in repo Samsung/appium-tizen-driver, so that's why I report here https://github.com/Samsung/appium-tizen-driver/issues/10

KazuCocoa commented 4 months ago

appium:rcOnly caps would help. Then it skips https://github.com/headspinio/appium-tizen-tv-driver/blob/8abdede79baab1a1382b8e7c91c385bc23a99066/packages/appium-tizen-tv-driver/lib/driver.js#L326

Jiyvn commented 4 months ago

thank you @KazuCocoa. I am able to connect to the tv after setting appium:rcOnly to true, but unfortunately, our app is web-based.

image
KazuCocoa commented 4 months ago

Then, so far, it looks like the debug command is used to get debug port by the test target to attach to a chromedriver session. Perhaps... if we have a way to detect a method to get the app's debug port somehow, it will be able to skip. For example useOpenDebugPort capability is it. If you already know the debug port on the tv device, it will let you skip the debug command

https://github.com/headspinio/appium-tizen-tv-driver/blob/8abdede79baab1a1382b8e7c91c385bc23a99066/packages/appium-tizen-tv-driver/lib/driver.js#L361-L364

If no, this driver would not work in such environment unfortunately