opened
ania-s
username_0
## Environment

* Appium version (or git revision) that exhibits the issue: 1.14.2
* Desktop OS/version used to run Appium: MacOS
* Node.js version (unless using Appium.app|exe): 10.15.3
* Npm or Yarn package manager: npm 6.4.1
* Mobile platform/version under test: Android 8.1.0
* Real device:Nexus 6P
* Webdriverio: 5.11.12

## Appium logs

[35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session/8e5232a7-7c5a-433f-9917-c70598fc93da/execute/sync[39m
[35m[HTTP][39m [90m{"script":"mobile: shell","args":["echo","1"]}[39m
[35m[W3C (8e5232a7)][39m Driver proxy active, passing request on via HTTP proxy
[debug] [35m[WD Proxy][39m Matched '/wd/hub/session/8e5232a7-7c5a-433f-9917-c70598fc93da/execute/sync' to command name 'execute'
[debug] [35m[Protocol Converter][39m Did not know how to rewrite the original URL '/wd/hub/session/8e5232a7-7c5a-433f-9917-c70598fc93da/execute/sync' for W3C protocol
[debug] [35m[WD Proxy][39m Proxying [POST /wd/hub/session/8e5232a7-7c5a-433f-9917-c70598fc93da/execute/sync] to [POST http://127.0.0.1:8000/wd/hub/session/aec66d2aa32ff7f3b778821e638517ce/execute/sync] with body: {"script":"mobile: shell","args":["echo","1"]}
[35m[WD Proxy][39m Got an unexpected response with status 500: {"value":{"error":"javascript error","message":"javascript error: shell is not defined\n  (Session info: chrome=80.0.3987.99)","stacktrace":"0   chromedriver_mac64_v80.0.3987.106   0x0000000102342329 chromedriver_mac64_v80.0.3987.106 + 3838761\n1   chromedriver_mac64_v80.0.3987.106   0x00000001022dc123 chromedriver_mac64_v80.0.3987.106 + 3420451\n2   chromedriver_mac64_v80.0.3987.106   0x000000010205062f chromedriver_mac64_v80.0.3987.106 + 751151\n3   chromedriver_mac64_v80.0.3987.106   0x0000000102053505 chromedriver_mac64_v80.0.3987.106 + 763141\n4   chromedriver_mac64_v80.0.3987.106   0x000000010205331e chromedriver_mac64_v80.0.3987.106 + 762654\n5   chromedriver_mac64_v80.0.3987.106   0x0000000102053e67 chromedriver_mac64_v80.0.3987.106 + 765543\n6   chromedriver_mac64_v80.0.3987.106   0x0000000101fe7de9 chromedriver_mac64_v80.0.3987.106 + 323049\n7   chromedriver_mac64_v80.0.3987.106   0x0000000101fda4a2 chromedriver_mac64_v80.0.3987.106 + 267426\n8   chromedriver_mac64_v80.0.3987.106   0x0000000101fe...
[debug] [35m[W3C (8e5232a7)][39m Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: 500 - {"value":{"error":"javascript error","message":"javascript error: shell is not defined\n  (Session info: chrome=80.0.3987.99)","stacktrace":"0   chromedriver_mac64_v80.0.3987.106   0x0000000102342329 chromedriver_mac64_v80.0.3987.106 + 3838761\n1   chromedriver_mac64_v80.0.3987.106   0x00000001022dc123 chromedriver_mac64_v80.0.3987.106 + 3420451\n2   chromedriver_mac64_v80.0.3987.106   0x000000010205062f chromedriver_mac64_v80.0.3987.106 + 751151\n3   chromedriver_mac64_v80.0.3987.106   0x0000000102053505 chromedriver_mac64_v80.0.3987.106 + 763141\n4   chromedriver_mac64_v80.0.3987.106   0x000000010205331e chromedriver_mac64_v80.0.3987.106 + 762654\n5   chromedriver_mac64_v80.0.3987.106   0x0000000102053e67 chromedriver_mac64_v80.0.3987.106 + 765543\n6   chromedriver_mac64_v80.0.3987.106   0x0000000101fe7de9 chromedriver_mac64_v80.0.3987.106 + 323049\n7   chromedriver_mac64_v80.0.3987.106   0x0000000101fda4a2 chromedriver_mac64_v80.0.3987.106 + 267426\n8   chromedriver_mac64_v80.0.3987.106   0x0000000101fe738b chromedriver_mac64_v80.0.3987.106 + 320395\n9   chromedriver_mac64_v80.0.3987.106   0x0000000101fda7b3 chromedriver_mac64_v80.0.3987.106 + 268211\n10  chromedriver_mac64_v80.0.3987.106   0x0000000101fb40bd chromedriver_mac64_v80.0.3987.106 + 110781\n11  chromedriver_mac64_v80.0.3987.106   0x0000000101fb5055 chromedriver_mac64_v80.0.3987.106 + 114773\n12  chromedriver_mac64_v80.0.3987.106   0x0000000102303ebf chromedriver_mac64_v80.0.3987.106 + 3583679\n13  chromedriver_mac64_v80.0.3987.106   0x0000000102310e4a chromedriver_mac64_v80.0.3987.106 + 3636810\n14  chromedriver_mac64_v80.0.3987.106   0x0000000102310be7 chromedriver_mac64_v80.0.3987.106 + 3636199\n15  chromedriver_mac64_v80.0.3987.106   0x00000001022e7839 chromedriver_mac64_v80.0.3987.106 + 3467321\n16  chromedriver_mac64_v80.0.3987.106   0x0000000102311707 chromedriver_mac64_v80.0.3987.106 + 3639047\n17  chromedriver_mac64_v80.0.3987.106   0x00000001022f9cc7 chromedriver_mac64_v80.0.3987.106 + 3542215\n18  chromedriver_mac64_v80.0.3987.106   0x0000000102327324 chromedriver_mac64_v80.0.3987.106 + 3728164\n19  chromedriver_mac64_v80.0.3987.106   0x0000000102348387 chromedriver_mac64_v80.0.3987.106 + 3863431\n20  libsystem_pthread.dylib             0x00007fff7febb2eb _pthread_body + 126\n21  libsystem_pthread.dylib             0x00007fff7febe249 _pthread_start + 66\n22  libsystem_pthread.dylib             0x00007fff7feba40d thread_start + 13\n"}}
[debug] [35m[W3C (8e5232a7)][39m     at JWProxy.proxy (/Users/myuser/app/test/acceptance/app/node_modules/appium-chromedriver/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:213:13)
[debug] [35m[W3C][39m Matched W3C error code 'javascript error' to JavaScriptError
Javascript error: shell is not defined
issue
created
mykola-mokhnach
username_1
This call is only supported in native context for now
comment
created
ania-s
username_0
So is there any way to run shell commands through automation?
comment
created
mykola-mokhnach
username_1
switch to native context?
comment
created
mykola-mokhnach
username_1
The patch has been merged to appium@beta
comment
closed
mykola-mokhnach
username_1
issue
created
ania-s
username_0
How should the whole call be defined so it works? I used below version but I tried few different ones as well and nothing worked for me:

```
const args_list = ["am", "broadcast", "-a", "android.intent.action.VIEW", "-d", "xxxx://xxxx.ext.yyyy.com/?type=cancel_navigation"];
const output = browser.executeScript("mobile: shell", args_list);
```
comment
created
mykola-mokhnach
username_1
Feel free to use Appium forum for questions
comment
created
mykola-mokhnach
username_1
https://appiumpro.com/editions/84
comment
created
ania-s
username_0
Frankly saying it's very discouraging to use it as most of the time I get no answers :/ Otherwise I would definitely go there every time I have a problem.
comment
created
mykola-mokhnach
username_1
Ahm, what can I say? Consider using paid services if you need immediate answers and/or consultants assistance.
comment
created
ania-s
username_0
Actually I didn't think about it. Will check this option with my company. Thanks
comment