日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

android remote shell,关于 Appium V1.7.2 新增的唯一安卓可执行 mobile 命令 shell 的疑问...

發布時間:2025/3/8 11 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android remote shell,关于 Appium V1.7.2 新增的唯一安卓可执行 mobile 命令 shell 的疑问... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

關于 mobile: shell 在更新日志中說明,是從 1.7.1 升級到 1.7.2 中 “Add --relaxed-security, and mobile: shell access to adb”,并搜索 github 中 appium 庫,找到需要配置 desiredcapabilities 中 relaxedSecurityEnabled 為 true,但實際執行無效。

TesterHome 社區有沒有 Appium 項目組的大牛,能否跟進了解一下這個 mobile: shell 到底如何使用

我的 python 代碼:

###

···python

def AndroidAppEmulator(platformVersion, appActivity, appPackage):

caps = {}

caps['relaxedSecurityEnabled'] = True

caps['automationName'] = 'UiAutomator2'

caps['platformName'] = 'Android'

caps['platformVersion'] = platformVersion

caps['deviceName'] = 'Android Emulator'

caps['appPackage'] = appPackage

caps['appActivity'] = appActivity

caps['unicodeKeyboard'] = True

caps['resetKeyboard'] = True

return WebDriver('http://127.0.0.1:4723/wd/hub', caps)

driver = learnappium.AndroidAppEmulator('7.1.1','.DialtactsActivity','com.android.dialer')

opts={'command':'am',

'args':['start','-N','com.android.calculator2/.Calculator']}

driver.execute_script('mobile: shell', opts)

報錯信息如下:

###

···

File "C:/Users/jack/PycharmProjects/AppiumTest/learnappium/Test06.py", line 9, in

print(driver.execute_script('mobile: shell', opts))

File "C:\Users\jack\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium-3.8.0-py3.6.egg\selenium\webdriver\remote\webdriver.py", line 546, in execute_script

'args': converted_args})['value']

File "C:\Users\jack\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium-3.8.0-py3.6.egg\selenium\webdriver\remote\webdriver.py", line 311, in execute

self.error_handler.check_response(response)

File "C:\Users\jack\AppData\Local\Programs\Python\Python36\lib\site-packages\appium_python_client-0.26-py3.6.egg\appium\webdriver\errorhandler.py", line 29, in check_response

File "C:\Users\jack\AppData\Local\Programs\Python\Python36\lib\site-packages\appium_python_client-0.26-py3.6.egg\appium\webdriver\errorhandler.py", line 24, in check_response

File "C:\Users\jack\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium-3.8.0-py3.6.egg\selenium\webdriver\remote\errorhandler.py", line 237, in check_response

raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Appium server must have relaxed security flag set in order to run any shell commands

···

總結

以上是生活随笔為你收集整理的android remote shell,关于 Appium V1.7.2 新增的唯一安卓可执行 mobile 命令 shell 的疑问...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。