需要 Appium-Help:模拟器未从 Appium.app 启动应用程序

Posted

技术标签:

【中文标题】需要 Appium-Help:模拟器未从 Appium.app 启动应用程序【英文标题】:Appium-Help required: Simulator is not launching application from Appium.app 【发布时间】:2014-08-21 18:50:27 【问题描述】:

在运行 Appium 应用程序进行自动化移动应用程序测试时遇到问题

以下我正在使用的工具版本 Appium 版本:1.2.1 Xcode:5.1.1

以下是我正在做的步骤,

    下载 Appium.dmg 运行 dmg 文件,然后启动 appium.app 文件 从 Xcode 为 7.1 模拟器构建应用程序 在 appium.app 上,启用“应用程序路径”选项并提供 .app 文件路径“/Users/umairrashid/Library/Application Support/iPhone Simulator/7.1/Applications/878133B5-7078-4E92-B3A2-607A3A3C2AC3/Recipes.应用” 在“常规设置”中, 服务器地址:127.0.0.1,端口:4723 检查更新:已启用 新命令超时:7200s

当我点击“启动”按钮时,一切似乎都正常。

当我点击“Inspector”按钮然后显示以下错误时,

无法启动 Appium Inspector

无法开始新会话

确保 Appium 服务器正在使用 Appium.app 中的“App Path”参数打开的应用程序(以及 android 的包和活动)或通过连接 selenium 客户端并在所需的功能对象中提供它来运行。

在 Appium 控制台中,出现以下错误,

2014-08-21T17:57:57.789Z - info: --> POST /wd/hub/session "desiredCapabilities":"platformName":"ios","platformVersion":"7.1","newCommandTimeout":"999999","automationName":"Appium"

2014-08-21T17:57:57.792Z - info: <-- POST /wd/hub/session 500 3.235 ms - 286 



2014-08-21T17:57:57.772Z - debug: Request received with params: 

2014-08-21T17:57:57.772Z - debug: Responding to client with success: "status":0,"value":"build":"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"

2014-08-21T17:57:57.775Z - debug: Appium request initiated at /wd/hub/sessions

2014-08-21T17:57:57.775Z - debug: Request received with params: 

2014-08-21T17:57:57.775Z - debug: Responding to client with success: "status":0,"value":[]

2014-08-21T17:57:57.789Z - debug: Appium request initiated at /wd/hub/session

2014-08-21T17:57:57.789Z - debug: Request received with params: "desiredCapabilities":"platformName":"iOS","platformVersion":"7.1","newCommandTimeout":"999999","automationName":"Appium"

2014-08-21T17:57:57.790Z - error: The following desired capabilities are required, but were not provided: deviceName

2014-08-21T17:57:57.790Z - debug: Got configuration error, not starting session

2014-08-21T17:57:57.791Z - debug: Cleaning up appium session

2014-08-21T17:57:57.791Z - error: Failed to start an Appium session, err was: Error: The following desired capabilities are required, but were not provided: deviceName

2014-08-21T17:57:57.791Z - debug: Error: The following desired capabilities are required, but were not provided: deviceName

    at Capabilities.checkValidity (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/lib/server/capabilities.js:120:13)

    at Appium.configure (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/lib/appium.js:256:35)

    at Appium.start (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/lib/appium.js:100:10)

    at Object.exports.createSession [as handle] (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/lib/server/controller.js:159:16)

    at next_layer (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/route.js:103:13)

    at Route.dispatch (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/route.js:107:5)

    at /Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:213:24

    at Function.proto.process_params (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:286:12)

    at next (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:207:19)

    at next (/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:182:38)

2014-08-21T17:57:57.791Z - debug: Responding to client with error: "status":33,"value":"message":"A new session could not be created. (Original error: The following desired capabilities are required, but were not provided: deviceName)","origValue":"The following desired capabilities are required, but were not provided: deviceName","sessionId":null



2014-08-21T17:58:08.130Z - info: --> GET /wd/hub/status 



—————————————————



When Launching with ‘Prelaunch Application’:Enabled, got following errors



2014-08-21T18:00:55.417Z - debug: Attempting to retry launching instruments, this is retry #3

2014-08-21T18:00:55.418Z - debug: Killall iPhoneSimulator



2014-08-21T18:01:00.420Z - info: Launching instruments



2014-08-21T18:01:00.421Z - debug: Attempting to run app on iPhone Retina (4-inch) - Simulator - iOS 7.1



2014-08-21T18:01:00.422Z - debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w iPhone Retina (4-inch) - Simulator - iOS 7.1 /Users/umairrashid/Library/Application Support/iPhone Simulator/7.1/Applications/878133B5-7078-4E92-B3A2-607A3A3C2AC3/Recipes.app -e UIASCRIPT /Users/umairrashid/Library/Application Support/appium/bootstrap/bootstrap-7a459bb511e03f3b.js -e UIARESULTSPATH /tmp/appium-instruments

2014-08-21T18:01:00.422Z - debug: And extra without-delay env: "DYLD_INSERT_LIBRARIES":"/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib","LIB_PATH":"/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"

2014-08-21T18:01:00.422Z - debug: And launch timeouts (in ms): "global":90000



2014-08-21T18:01:01.415Z - debug: [INST STDERR] Instruments Usage Error : Could not remove existing output document 'file:///Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/instrumentscli0.trace': Error Domain=NSCocoaErrorDomain Code=642 "You can’t save the file “instrumentscli0.trace” because the volume “Appium” is read only." UserInfo=0x7fac5e2d6100 NSFilePath=/Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/instrumentscli0.trace, NSUnderlyingError=0x7fac5d92d760 "The operation couldn’t be completed. Read-only file system".





2014-08-21T18:01:01.483Z - debug: [INSTSERVER] Instruments exited with code 254



2014-08-21T18:01:01.483Z - debug: Killall instruments



2014-08-21T18:01:01.486Z - debug: Instruments crashed on startup

我希望当我从 Appium 中单击 Inspect 按钮时,模拟器会启动,我可以在该视图中看到 XPath 等。

【问题讨论】:

您的错误消息表明您缺少“设备名称”所需的功能。 谢谢斯塔尔。通过将 appium.app 放在 Mac 的“应用程序”文件夹中并在所需功能中提供“设备名称”来解决问题。 【参考方案1】:

    你确定你选择了苹果的图标吗(有时我们会犯愚蠢的误点击)

    如果您勾选了“强制装置”,请取消勾选。

如果您仍然有问题,最好将您的 appium gui 截图并发布在此处,以便我可以更全面地提供帮助

【讨论】:

你能告诉我这个问题吗? ***.com/questions/26003675/…–【参考方案2】:

您确定您已经通过将 Appium.app 拖到您的应用程序文件夹中安装了 Appium 吗?

以下错误消息表明您只是从 DMG 文件启动它。

Instruments Usage Error : Could not remove existing output document 'file:///Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/instrumentscli0.trace'

【讨论】:

感谢前卫。将 Appium.app 拖入 Applications 文件夹即可解决问题。 我也有同样的问题..你能看看吗? ***.com/questions/26003675/…–

以上是关于需要 Appium-Help:模拟器未从 Appium.app 启动应用程序的主要内容,如果未能解决你的问题,请参考以下文章

模拟摩托车数据库实例未从 EnableIAMDatabaseAuthentication 参数读取

未从 Firebase 收到通知

未从 Android 地理围栏事件收到 Intent

未从 testflight 下载的按需资源

数据未从 iphone 传输到真实设备上的 iWatch (AppleWatch)

APK 版本未从 Play 商店更新已安装的 AAB 应用