In C#, I’ve set Desired Capabilities “app” pointing to an unc .apk file path.
DesiredCapabilities.SetCapability(“app”, @“\\server\shared\dropbox\example.apk”);
Error found in Windows Appium Server log:
info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Android\sdk\platform-tools\adb.exe -s emulator-5554 push “\\\\server\\shared\\dropbox\\example.apk” /data/local/tmp/9dd564b37db477bd9777f304f2e8c3cf.apk”
cannot stat ‘\\\\server\\shared\\dropbox\\example.apk’: No such file or directoryat ChildProcess.exithandler (child_process.js:213:12) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:818:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:"A new session could not be created. > (Original error: Command failed: C:\\Windows\\system32\\cmd.exe /s /c "C:\\Android\\sdk\\platform-tools\\adb.exe -s
emulator-5554 push "\\\\\\\\server\\\\shared\\\\dropbox\\\\example.apk" /data/local/tmp/9dd564b37db477bd9777f304f2e8c3cf.apk"\ncannot stat ‘\\\\\\\\server\\\\shared\\\\dropbox\\\\example.apk’: No such file or directory\r
\n)",“killed”:false,“code”:1,“signal”:null,“cmd”:"C:\\Windows\\system32\\cmd.exe /s /c "C:\\Android\\sdk\\platform-tools\\adb.exe -s emulator-5554 push "\\\\\\\\server\\\\shared\\\\dropbox\\\\example.apk"
/data/local/tmp/9dd564b37db477bd9777f304f2e8c3cf.apk"",“origValue”:"Command failed: C:\\Windows\\system32\\cmd.exe /s /c "C:\\Android\\sdk\\platform-tools\\adb.exe -s emulator-5554 push "\\\\\\\\server\\\\shared\\\\dropbox\\\\example.apk
In Windows Command Prompt, I tried below command and returned the same error.
C:>adb.exe -s emulator-5554 push “\\\\server\\shared\\dropbox\\example.apk” /d
ata/local/tmp/9dd564b37db477bd9777f304f2e8c3cf.apk
cannot stat ‘\\\\server\\shared\\dropbox\\example.apk’: No such file or directo
ry
Then I tried the same command replacing ‘\\’ with single backslash '' and it works
C:>adb.exe -s emulator-5554 push “\\server\shared\dropbox\example.apk” /data/local/t
mp/9dd564b37db477bd9777f304f2e8c3cf.apk
2480 KB/s (2730639 bytes in 1.075s)
The double backslash caused the issue. So in my code, I tried setting my unc path with forward-slash and still triggered the exact same error message as above
@"//server/shared/dropbox/example.apk
This seems to be a bug, or is there a way to tell the server NOT to translate single backslash to double?