Appium appium 点击 Launch,模拟器自动打开进入项目,项目一直闪退。

贾小超 · 2015年07月02日 · 最后由 wy12345 回复于 2015年11月11日 · 3041 次阅读

日志太多,我贴上一些关键性的日志(黄色字体的)。

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

warn: Could not parse app Localizable.strings assuming it doesn't exist

info: [debug] [INST STDERR] 2015-07-02 11:40:24.233 instruments[4766:91654] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

第一次搞 appium,谁遇到过这样的坑, 帮忙解答一下。

点击 Inspector 跳出弹出框是:

这个 inspector 点击出现的问题我见论坛有人遇到过,帖子里面没有给出具体什么问题,解决方案是什么。

共收到 16 条回复 时间 点赞

不是权限问题,因为我 automation 运行写脚本都没有问题。

1、 log 和代码使用代码块:

代码块

2、 不要只给你觉得有问题的少数几条 Log ,给出完整的 log(接收到 create session 请求到返回 fail 信息)

#2 楼 @chenhengjie123
这里链接真机时报的 log

info: [debug] Starting Appium in pre-launch mode

info: Pre-launching app
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 1414c691-2f67-48ca-adae-53330577fdaf

info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder

info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version

info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.3
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate

info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.android.yougou/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.android.yougou/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn't exist
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/yougou/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/yougou/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Reusing dynamic bootstrap: /Users/yougou/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.1","iOSSDKVersion":"8.3","deviceName":"iPhone 5","platformVersion":"8.3"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 5 (8.3 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons

info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole

info: [debug] Cleaning up appium session

error: Log capture did not start in a reasonable amount of time

第一次发帖 下次格式一定改

@smallboy 请问这个问题你解决了吗。我现在也陷入同样的困境

同进一个坑

app 是用模拟器的 sdk 打的包吗?

这个问题解决了吗?我也遇到这个问题了

感觉碰到这个问题的人很多啊~

如果证书没有问题的话,把 appium 的超时时间改大点试试。

遇到这种问题,先做一件事情。使用 xcode 的 instruments 的 UIAutomation 直接打开应用,开始 record,然后播放下,看看应用本身是否能自动化。

前一阵子 mac 坏了 运维带去修 重新做了系统,今天刚刚做好 又重新安装一遍 现在又出现了新的问题。。。

warn: Could not parse app Localizable.strings assuming it doesn't exist
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/yougou/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/yougou/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
info: [debug] Reusing dynamic bootstrap: /Users/yougou/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
warn: Could not capture device log using libimobiledevice idevicesyslog. Libimobiledevice probably isn't installed
info: [debug] Attempting iOS device log capture via deviceconsole

info: [debug] Creating iDevice object with udid 73b242b7aa0884650d8efce45b71aebf407e50f5

info: [debug] Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller

info: [debug] App is not installed. Will try to install the app.

info: [debug] Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller -i com.android.yougou
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: [debug] Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller -i com.android.yougou
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:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller -i com.android.yougou\ndyld: 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","cmd":"/bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller -i com.android.yougou","origValue":"Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller -i com.android.yougou\ndyld: 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}
info: <-- POST /wd/hub/session 500 1458.586 ms - 1110 

warn: Could not capture device log using libimobiledevice idevicesyslog. Libimobiledevice probably isn't installed

重装下 libimobiledevice 试试。

@chenhengjie123 重装过了 现在又发现一个问题 UIAutomation 链接真机进行录制 真机会卡死 但是在虚拟机上面运行就正常。 Xcode 版本是 7.0 真机系统版本是 8.3 您有遇到过这样的情况么?

Xcode 7.0 上没试过录制。
卡死的话报啥错?

怎么重装 libimobiledevice,

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