desired_caps['app'] = PATH('C:\Users\Stephen\Desktop\ContactManager.apk')
是必须的吗?
如果不需要安装,直接运行机器里已经安装好的应用,要怎么处理?
我是直接注释掉了这行,你试试
不是必须的。
注掉不行的,试过了
会提示错误:
> info: [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m [90m{"desiredCapabilities":{"device":"Android","version":"4.4","platformName":"Android","deviceName":"Test","app-package":"com.android.contacts","app-activity":"activities.PeopleActivity"}}[39m
> error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device
> info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : device, version, app-package, app-activity
> error: Failed to start an Appium session, err was: Error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device
> info: [debug] No appActivity desired capability or server param. Parsing from apk.
Sample-code 中 “android-simple”,我注掉:
// desired.app = require("./helpers/apps").androidApiDemos;
提示:
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device)","origValue":"No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device"},"sessionId":null}
@hopecao or set androidPackage to launch pre-existing app on device! 注释掉后请设置 appPackage,appActivity。非"app-package","app-activity"
@xuxu 多谢!