Appium 跪求!!!运行 appium 时报错

爱哭の毛毛虫 · 2014年04月24日 · 最后由 云飞凌风 回复于 2014年08月21日 · 2139 次阅读

运行 appium 时报错
error: Could not determine your device from Appium arguments or desired capabil
ties. Please make sure to specify the 'deviceName' capability
info: Got configuration error, not starting session
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not determine y
ur device from Appium arguments or desired capabilities. Please make sure to sp
cify the 'deviceName' capability
info: Error: Could not determine your device from Appium arguments or desired c
pabilities. Please make sure to specify the 'deviceName' capability
at Appium.getDeviceType (C:\Documents and Settings\Administrator\Applicatio
Data\npm\node_modules\appium\lib\appium.js:123:9)
at Appium.configure (C:\Documents and Settings\Administrator\Application Da
a\npm\node_modules\appium\lib\appium.js:255:23)
at Appium.start (C:\Documents and Settings\Administrator\Application Data\n
m\node_modules\appium\lib\appium.js:102:10)
at exports.createSession (C:\Documents and Settings\Administrator\Applicati
n Data\npm\node_modules\appium\lib\server\controller.js:156:16)
at callbacks (C:\Documents and Settings\Administrator\Application Data\npm\
ode_modules\appium\node_modules\express\lib\router\index.js:164:37)
at param (C:\Documents and Settings\Administrator\Application Data\npm\node
modules\appium\node_modules\express\lib\router\index.js:138:11)
at pass (C:\Documents and Settings\Administrator\Application Data\npm\node_
odules\appium\node_modules\express\lib\router\index.js:145:5)
at nextRoute (C:\Documents and Settings\Administrator\Application Data\npm\
ode_modules\appium\node_modules\express\lib\router\index.js💯7)
at callbacks (C:\Documents and Settings\Administrator\Application Data\npm\
ode_modules\appium\node_modules\express\lib\router\index.js:167:11)
at C:\Documents and Settings\Administrator\Application Data\npm\node_module
\appium\lib\server\controller.js:42:7
info: Responding to client with error: {"status":33,"value":{"message":"A new s
ssion could not be created. (Original error: Could not determine your device fr
m Appium arguments or desired capabilities. Please make sure to specify the 'de
iceName' capability)","origValue":"Could not determine your device from Appium
rguments or desired capabilities. Please make sure to specify the 'deviceName'
apability"},"sessionId":null}

共收到 9 条回复 时间 点赞

Could not determine your device from Appium arguments or desired capabil
ties. Please make sure to specify the 'deviceName' capability

#1 楼 @anikikun 我也知道,但是我不知道怎么去设置。。。请大侠明鉴

你的代码贴上来看一下

启动 appium 的时候后面加上 -U+ 设备 UDID 没?

加上 --plantform-name ios 或者 --plantform-name android 试试

#1 楼 @anikikun 加上 --plantform-name ios 或者 --plantform-name android 试试

我也遇到这个问题了,appium 1.0 版本,启动时即使是这样 D:\Appium-1.0.0>Appium.exe --plantform-name android --devicename HTC --UHC374W902582 ,inspector 还是有会报这个问题。 用 uiautomatorviewer 定位元素倒是没问题的。

UDID 设一下

#2 楼 @leilei10086 该成类似于这种就可以啦
[caps addCapabilityForKey:@"platformName" andValue:@"iOS"];
[caps addCapabilityForKey:@"platformVersion" andValue:@"7.1"];
[caps addCapabilityForKey:@"deviceName" andValue:@"iPhone simulator"];

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册