出现“Posix 生成失败”错误 - Appium iOS

Posted

技术标签:

【中文标题】出现“Posix 生成失败”错误 - Appium iOS【英文标题】:Getting 'Posix spawn failure' error - Appium iOS 【发布时间】:2014-06-05 07:18:52 【问题描述】:

我正在尝试在 Appium ios 中使用 Java 为一个应用运行自动化脚本。

当我在 Simulator 上运行时,出现以下错误 -

info: Attempting to retry launching instruments, this is retry #1
info: Attempting to run app on iPhone Retina (4-inch) - Simulator - iOS 7.1

info: 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/abc/Desktop/smriti/iPhoneSimulator/AppIOS.app -e UIASCRIPT /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments
info: And extra without-delay env: "DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"
info: And launch timeout: 90000ms

info: [INST STDERR] posix spawn failure; aborting launch (binary == /Users/abc/Desktop/smriti/iPhoneSimulator/AppIOS.app/AppIOS).

info: [INST STDERR] Instruments Trace Error : Error Starting Recording

然后尝试在真实设备上运行,然后出现以下错误:

info: Installing ipa found at AppIOS.ipa
info: Creating iDevice object with udid 3daa1240e495c84e8878996649301fd9759a07df
info: Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller

info: Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Command failed: dyld: Library not loaded: @executable_path/../lib/libimobiledevice.3.dylib
Referenced from: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
Reason: image not found


info: Error: Command failed: dyld: Library not loaded: @executable_path/../lib/libimobiledevice.3.dylib
Referenced from: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
Reason: image not found

at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

info: Responding to client with error: "status":33,"value":"message":"A new session could not be created. (Original error: Command failed: dyld: Library not loaded: @executable_path/../lib/libimobiledevice.3.dylib\n  Referenced from: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller\n  Reason: image not found\n)","killed":false,"code":null,"signal":"SIGTRAP","origValue":"Command failed: dyld: Library not loaded: @executable_path/../lib/libimobiledevice.3.dylib\n  Referenced from: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller\n  Reason: image not found\n","sessionId":null
POST /wd/hub/session 500 4286ms - 714b

然后我在真实设备上运行时单击“i”启动 Appium 检查器 -> 它启动了我的应用程序,然后应用程序崩溃了。

任何帮助将不胜感激。

谢谢!

【问题讨论】:

你解决了吗??? 以防万一有人遇到同样的问题:我通过从所需功能中删除 platformVersion 解决了这个非常烦人且令人沮丧的问题。 【参考方案1】:

看看这两个线程中的任何一个的建议?

https://groups.google.com/forum/#!topic/appium-discuss/frhUdnCHMms

或者这个: https://groups.google.com/forum/#!msg/appium-discuss/HepKHApmm6w/mu6uGLyNLk0J

【讨论】:

【参考方案2】:

您不应尝试在模拟器上安装 IPA 文件。 AFAIK,它们是为 ARM 处理器构建的,只能在 iOS 设备上运行。

【讨论】:

以上是关于出现“Posix 生成失败”错误 - Appium iOS的主要内容,如果未能解决你的问题,请参考以下文章

python客户端和Appium服务端联调出现的问题解决办法

appium的webdriver和selenium有啥区别?

使用带有 Python 测试脚本的 Appium 驱动程序

用 JAVA 为 Appium 编写测试

AWS appium ios 测试总是失败

在 Python appium 中返回 self.find_element (by = By.ID, value = id_) 和异常错误