Appium mac+appium+python+ios 启动不了 appium

keson · 2017年06月30日 · 最后由 Stepthen 回复于 2017年07月08日 · 2958 次阅读


每次点 doctor 都会报这个错,试了很多方法也都没用,求各位大神帮看看😂 😂 😂
appium 的环境
wybdeMac:~ wyb$ appium-doctor
info AppiumDoctor Appium Doctor v.1.4.2
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 8.1.2
info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ Xcode Command Line Tools are installed.
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor ✔ HOME is set to: /Users/wyb
WARN AppiumDoctor ✖ ANDROID_HOME is NOT set!
WARN AppiumDoctor ✖ JAVA_HOME is NOT set!
WARN AppiumDoctor ✖ adb could not be found because ANDROID_HOME is NOT set!
WARN AppiumDoctor ✖ android could not be found because ANDROID_HOME is NOT set!
WARN AppiumDoctor ✖ emulator could not be found because ANDROID_HOME is NOT set!
WARN AppiumDoctor ✖ Bin directory for $JAVA_HOME is not set
info AppiumDoctor ### Diagnostic completed, 6 fixes needed. ###
info AppiumDoctor
info AppiumDoctor ### Manual Fixes Needed ###
info AppiumDoctor The configuration cannot be automatically fixed, please do the following first:
WARN AppiumDoctor - Manually configure ANDROID_HOME.
WARN AppiumDoctor - Manually configure JAVA_HOME.
WARN AppiumDoctor - Manually configure ANDROID_HOME and run appium-doctor again.
WARN AppiumDoctor - Add '$JAVA_HOME/bin' to your PATH environment
info AppiumDoctor ###
info AppiumDoctor
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!
info AppiumDoctor
wybdeMac:~ wyb$

appium 日志
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' appium/build/lib/main.js --address "127.0.0.1" --pre-launch --debug-log-spacing --platform-version "9.3" --platform-name "iOS" --app "com.joan.wrz" --udid "daddfba84c5cfce3d48d3c67b7324e4688997733" --no-reset --show-ios-log --device-name "iPhone 5s" --native-instruments-lib

[Appium] Welcome to Appium v1.5.3

[Appium] Non-default server args:

[Appium] address: '127.0.0.1'
[Appium] launch: true
[Appium] debugLogSpacing: true
[Appium] platformName: 'iOS'
[Appium] platformVersion: '9.3'
[Appium] deviceName: 'iPhone 5s'

[Appium] app: 'com.joan.wrz'
[Appium] udid: 'daddfba84c5cfce3d48d3c67b7324e4688997733'
[Appium] noReset: true
[Appium] nativeInstrumentsLib: true

[Appium] showIOSLog: true
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities '{"platformName":"iOS"}'
[Appium] --platform-version => --default-capabilities '{"platformVersion":"9.3"}'
[Appium] --device-name => --default-capabilities '{"deviceName":"iPhone 5s"}'
[Appium] --app => --default-capabilities '{"app":"com.joan.wrz"}'
[Appium] -U,--udid => --default-capabilities '{"udid":"daddfba84c5cfce3d48d3c67b7324e4688997733"}'
[Appium] --no-reset => --default-capabilities '{"noReset":true}'
[Appium] --native-instruments-lib => --default-capabilities '{"nativeInstrumentsLib":true}'
[Appium] --show-ios-log => --default-capabilities '{"showIOSLog":true}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:

[Appium] platformName: 'iOS'

[Appium] platformVersion: '9.3'
[Appium] deviceName: 'iPhone 5s'
[Appium] app: 'com.joan.wrz'
[Appium] udid: 'daddfba84c5cfce3d48d3c67b7324e4688997733'
[Appium] noReset: true
[Appium] nativeInstrumentsLib: true
[Appium] showIOSLog: true

[Appium] Appium REST http interface listener started on 127.0.0.1:4723

[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 31 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...
[HTTP] <-- GET /wd/hub/status 200 15 ms - 83

[HTTP] --> GET /wd/hub/sessions {}
[MJSONWP] Calling AppiumDriver.getSessions() with args: []

[MJSONWP] Responding to client with driver.getSessions() result: []

[HTTP] <-- GET /wd/hub/sessions 200 4 ms - 40

[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","newCommandTimeout":"7200","app":"/Users/wyb/Library/Developer/Xcode/DerivedData/wrz-henmzyssrrpjrtanpnymyqmvlopz/Build/Products/Debug-iphoneos/微融资.app","platformVersion":"9.3","deviceName":"iPhone 5s","bundleId":"com.joan.wrz","automationName":"Appium","udid":"daddfba84c5cfce3d48d3c67b7324e4688997733"}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","new...

[Appium] Creating new IosDriver session

[Appium] Capabilities:

[Appium] platformName: 'iOS'

[Appium] newCommandTimeout: '7200'
[Appium] app: '/Users/wyb/Library/Developer/Xcode/DerivedData/wrz-henmzyssrrpjrtanpnymyqmvlopz/Build/Products/Debug-iphoneos/微融资.app'
[Appium] platformVersion: '9.3'
[Appium] deviceName: 'iPhone 5s'
[Appium] bundleId: 'com.joan.wrz'

[Appium] automationName: 'Appium'
[Appium] udid: 'daddfba84c5cfce3d48d3c67b7324e4688997733'
[Appium] noReset: true
[Appium] nativeInstrumentsLib: true
[Appium] showIOSLog: true
[BaseDriver] Capability 'newCommandTimeout' changed from string ('7200') to integer (7200). This may cause unexpected behavior

[BaseDriver] Session created with session id: 575f900e-a6ab-4778-96b4-c7e9fb4286f9

[debug] [iOS] Not auto-detecting udid.

[BaseDriver] Using local app '/Users/wyb/Library/Developer/Xcode/DerivedData/wrz-henmzyssrrpjrtanpnymyqmvlopz/Build/Products/Debug-iphoneos/微融资.app'

[debug] [iOS] Removing any remaining instruments sockets

[debug] [iOS] Cleaned up instruments socket /var/folders/06/69krqdpj2p1gnyx5w100nsq00000gn/T/instruments_sock

[debug] [iOS] No language specified. Using default strings

[debug] [iOS] Strings file not found. Looking in 'en.lproj' directory
[iOS] Could not file localizable strings file 'Localizable.strings'!

[debug] [iOS] Creating instruments
[debug] [UIAuto] Preparing bootstrap code

[debug] [UIAuto] Dynamic bootstrap dir: /Users/wyb/Library/Application Support/appium/bootstrap
[debug] [UIAuto] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js","instrumentsSock":"/var/folders/06/69krqdpj2p1gnyx5w100nsq00000gn/T/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}

[debug] [UIAuto] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...

[debug] [UIAuto] Dynamic bootstrap path: /Users/wyb/Library/Application Support/appium/bootstrap/bootstrap-6958804ed19bc6a4.js

[debug] [UIAuto] Reusing dynamic bootstrap: /Users/wyb/Library/Application Support/appium/bootstrap/bootstrap-6958804ed19bc6a4.js
[debug] [iOS] Reset not set, continuing
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'

[debug] [iOS] Creating iDevice object with udid daddfba84c5cfce3d48d3c67b7324e4688997733

[debug] [iOS] App is not installed. Will try to install.

[MJSONWP] Encountered internal error running command: Error: Installing /Users/wyb/Library/Developer/Xcode/DerivedData/wrz-henmzyssrrpjrtanpnymyqmvlopz/Build/Products/Debug-iphoneos/微融资.app failed
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/node-idevice/main.js:159:6
at ChildProcess.exithandler (child_process.js:193:7)
at emitTwo (events.js💯13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

[HTTP] <-- POST /wd/hub/session 500 1182 ms - 278

共收到 6 条回复 时间 点赞

[MJSONWP] Encountered internal error running command: Error: Installing /Users/wyb/Library/Developer/Xcode/DerivedData/wrz-henmzyssrrpjrtanpnymyqmvlopz/Build/Products/Debug-iphoneos/微融资.app failed

从日志看是安装 app 失败了,你是要启动已安装后的 app 吗,把 appium 设置界面贴出来,是不是你设置的不对?

—— 来自 TesterHome 官方 安卓客户端

另外 session 创建后,关闭 session 前,是可以直接使用的,可以在代码中加断点时调试用

—— 来自 TesterHome 官方 安卓客户端

你先试下手动安装 app 是否正常吧?

陈恒捷 回复

手动安装 app 是可以的

Stepthen 回复



keson 回复

@w8090 ,解决没? 我没用过这种方法启动 app, 从截图没看到哪里有问题,有没有试一下 把 app 的名称换成英文

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