@all
appium 上的 IOS setting

java 测试代码
public class AppLoginTest {

private WebDriver driver;

@Before
public void setUp() throws Exception {
// set up appium
File classpathRoot = new File(System.getProperty("user.dir"));
System.out.println(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "apps");
File app = new File(appDir, "reliao.ipa");
DesiredCapabilities capabilities = new DesiredCapabilities();
//capabilities.setCapability("device","multiMedia");
capabilities.setCapability(MobileCapabilityType.VERSION, "7.1");
//capabilities.setCapability(MobileCapabilityType.ACCEPT_SSL_CERTS,true);
capabilities.setCapability(MobileCapabilityType.PLATFORM, "Mac");
capabilities.setCapability("deviceName","iphone");
capabilities.setCapability("platformName", "ios");
//capabilities.setCapability("app", app.getAbsolutePath());
//System.out.println(app.getAbsolutePath());
//capabilities.setCapability(MobileCapabilityType.APP,"com.iqiyi.reliao");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}

最后贴出 appium 报错信息
Launching Appium with command: '/Volumes/Appium 1/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --address "127.0.0.1" --command-timeout "7200" --platform-version "7.1" --platform-name "iOS" --app "/Users/a/git_zcr/reliao-automation/hotchat-test/apps/reliao.ipa" --udid "446f94713d060f49faa03fe14d5044e549e484cd" --show-sim-log --default-device

info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)

info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"app":"/Users/a/git_zcr/reliao-automation/hotchat-test/apps/reliao.ipa","udid":"446f94713d060f49faa03fe14d5044e549e484cd","address":"127.0.0.1","platformName":"iOS","platformVersion":"7.1","defaultDevice":true,"showSimulatorLog":true,"defaultCommandTimeout":7200}
warn: Deprecated server args: {"--show-sim-log":"use instead: --show-ios-log"}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}

info: <-- GET /wd/hub/status 200 8.219 ms - 104 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}

info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"IOS","version":"7.1","deviceName":"iphone","platform":"MAC"}}

info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version, platform
info: [debug] Using local .ipa from command line: /Users/a/git_zcr/reliao-automation/hotchat-test/apps/reliao.ipa
info: [debug] Copying local zip to tmp dir

info: [debug] /Users/a/git_zcr/reliao-automation/hotchat-test/apps/reliao.ipa copied to /var/folders/7f/bdnt2lkj3_lb26xzz7c9wj5m0000gn/T/115217-52035-r09wzz/appium-app.zip
info: [debug] Unzipping /var/folders/7f/bdnt2lkj3_lb26xzz7c9wj5m0000gn/T/115217-52035-r09wzz/appium-app.zip
info: [debug] Testing zip archive: /var/folders/7f/bdnt2lkj3_lb26xzz7c9wj5m0000gn/T/115217-52035-r09wzz/appium-app.zip

info: [debug] Zip archive tested clean

info: [debug] Unzip successful

info: [debug] Using locally extracted app: /var/folders/7f/bdnt2lkj3_lb26xzz7c9wj5m0000gn/T/115217-52035-r09wzz/Payload/reliao.app

info: [debug] Creating new appium session 3e619947-5d84-4a6e-af78-87c51b57e12c
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.1

parseFileSync() is deprecated. Use parseStringSync() instead.

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 /var/folders/7f/bdnt2lkj3_lb26xzz7c9wj5m0000gn/T/115217-52035-r09wzz/Payload/reliao.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /var/folders/7f/bdnt2lkj3_lb26xzz7c9wj5m0000gn/T/115217-52035-r09wzz/Payload/reliao.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings; assuming it doesn't exist
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
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/a/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Volumes/Appium 1/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Volumes/Appium 1/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,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/a/Library/Application Support/appium/bootstrap/bootstrap-b68f81badbd951b6.js
info: [debug] Reusing dynamic bootstrap: /Users/a/Library/Application Support/appium/bootstrap/bootstrap-b68f81badbd951b6.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1","iOSSDKVersion":"8.1","deviceName":"iphone","platformVersion":"7.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iphone (7.1 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] Not pre-launching simulator

info: [debug] Creating iDevice object with udid 446f94713d060f49faa03fe14d5044e549e484cd

error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh: /Volumes/Appium: is a directory

info: [debug] Couldn't find ideviceinstaller, trying built-in at /Volumes/Appium 1/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
info: [debug] Checking app install status using: /Volumes/Appium 1/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 446f94713d060f49faa03fe14d5044e549e484cd --bundle com.iqiyi.reliao
info: [debug] App is not installed. Will try to install the app.
info: [debug] Installing ipa found at /Users/a/git_zcr/reliao-automation/hotchat-test/apps/reliao.ipa
info: [debug] Creating iDevice object with udid 446f94713d060f49faa03fe14d5044e549e484cd
info: [debug] Couldn't find ideviceinstaller, trying built-in at /Volumes/Appium 1/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
info: [debug] Cleaning up appium session
info: [debug] Error: Command failed: /bin/sh: /Volumes/Appium: is a directory

at ChildProcess.exithandler (child_process.js:658:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Socket. (child_process.js:979:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh: /Volumes/Appium: is a directory\n)","killed":false,"code":126,"signal":null,"origValue":"Command failed: /bin/sh: /Volumes/Appium: is a directory\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 2307.131 ms - 278

info: --> GET /wd/hub/status {}

麻烦各位大侠们给看看,这 ideviceinstaller 我要怎么重新再 build?THANKS!!

此问题已经解决:ANDROID 环境配置的问题。用 appium-doctor 验证后发现没有配置好。


↙↙↙阅读原文可查看相关链接,并与作者交流