报错日志:
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) info: Appium REST http interface listener started on 0.0.0.0:4723 info: [debug] Non-default server args: {“udid”:“0123456789ABCDEF”,“bootstrapPort”:4721,“sessionOverride”:true,“noReset”:true,“log”:“D:/SmartBearKit_2020_03_17/smartbearkit/smartbear/log/test001.log”} info: Console LogLevel: debug info: File LogLevel: debug info: --> POST /wd/hub/session {“capabilities”:{“firstMatch”:[{“platformName”:“Android”,“appium:platformVersion”:“9.0.0”,“appium:deviceName”:“0123456789ABCDEF”,“appium:appPackage”:“com.lvshou.smartbearkit”,“appium:appActivity”:“com.lvshou.module.main.MainActivity”}]},“desiredCapabilities”:{“platformName”:“Android”,“platformVersion”:“9.0.0”,“deviceName”:“0123456789ABCDEF”,“appPackage”:“com.lvshou.smartbearkit”,“appActivity”:“com.lvshou.module.main.MainActivity”}} info: Client User-Agent string: appium/python 0.50 (selenium/3.141.0 (python windows)) info: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device info: [debug] Creating new appium session 77c4aaf0-191d-4d96-8a12-70e9127ec80d info: Starting android appium info: [debug] Getting Java version info: Java version is: 1.8.0_221 info: [debug] Checking whether adb is present info: [debug] Using adb from E:\sdk_pad\platform-tools\adb.exe warn: No app capability, can’t parse package/activity info: [debug] Using fast reset? false info: [debug] Preparing device for session info: [debug] Not checking whether app is present since we are assuming it’s already on the device info: Retrieving device info: [debug] Trying to find a connected android device info: [debug] Getting connected devices… info: [debug] executing cmd: E:\sdk_pad\platform-tools\adb.exe devices info: [debug] 1 device(s) connected info: Found device 0123456789ABCDEF info: [debug] Setting device id to 0123456789ABCDEF info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) info: [debug] executing cmd: E:\sdk_pad\platform-tools\adb.exe -s 0123456789ABCDEF wait-for-device error: Unhandled error: TypeError: this.shell is not a function at [object Object]. (E:\APPIUM\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:942:16) at [object Object]. (E:\APPIUM\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9) at ChildProcess.exithandler (child_process.js:204:7) at emitTwo (events.js?13) at ChildProcess.emit (events.js:185:7) at maybeClose (internal/child_process.js:827:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) context: [POST /wd/hub/session {“capabilities”:{“firstMatch”:[{“platformName”:“Android”,“appium:platformVersion”:“9.0.0”,“appium:deviceName”:“0123456789ABCDEF”,“appium:appPackage”:“com.lvshou.smartbearkit”,“appium:appActivity”:"com]
server的代码:
class Server:
def init(self):
self.dos = DosCmd()
def start_server(self):
command = "appium -p 4723 -bp 4721 -U 0123456789ABCDEF --no-reset --session-override --log D:/SmartBearKit_2020_03_17/smartbearkit/smartbear/log/test001.log"
self.dos.excute_cmd(command)
def main(self):
appium_start = threading.Thread(target=self.start_server)
appium_start.start()
time.sleep(30)
if name == ‘main’:
server = Server()