我正在尝试将 .app 文件加载到 ios 模拟器中,以在 Mac OS X El Capitan 版本 10.11.4 上测试 Cordova 混合应用程序。使用java + testng
Appium version : 1.5.2
Xcode version : 7.3
ios simulator used : iPhone 6 (9.3)
java version : 1.8.0_91
The desired capabilities are :
DesiredCapabilities cap= new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.IOS);
cap.setCapability(MobileCapabilityType.DEVICE_NAME,"iPhone Simulator");
File appdir = new File("src");
File app = new File(appdir,"/Users/spoonitydev/Downloads/TestApp.app");
我尝试了混合应用程序,但它不起作用。然后我尝试了一个原生 ios TestApp 来检查它是否是因为它是一个混合应用程序。但这也失败了在这两种情况下,我都从 Appium 服务器收到以下错误:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.
Original error: Could not extract Info.plist from application: Plist file
doesn exist:'/Users/spoonitydev/workspace/AndroidTest/src/Users/spoonitydev/Downloads
TestApp.app/Info.plist' (WARNING: The server did not provide any stacktrace information)
我可以从命令行将相同的应用程序 TestApp 加载到 ios 模拟器中
xcrun simctl install booted /Users/spoonitydev/Downloads/TestApp.app
所以这似乎是 Appium 服务器中的一个问题。
appium 日志是
[Appium] Welcome to Appium v1.5.2 (REV 6fdcab5abcffbbb0a3a734e1db7d7afe6cac753a)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app","platformName":"iOS","deviceName":"iPhone Simulator"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app","platformName":"iOS","deviceName":"iPhone Simulator...
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium] app: '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app'
[Appium] platformName: 'iOS'
[Appium] deviceName: 'iPhone Simulator'
[BaseDriver] Session created with session id: 698c8531-e612-4e4c-9aaa-ee4534d25553
[debug] [iOS] Not auto-detecting udid.
[BaseDriver] Using local app '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app'
[debug] [iOS] Removing any remaining instruments sockets
[debug] [iOS] Cleaned up instruments socket /var/folders/6h/8kb9nvyn695fh0p4jgy8yzp00000gp/T/instruments_sock
[debug] [iOS] Setting Xcode version
[debug] [iOS] Xcode version set to 7.3
[debug] [iOS] Setting iOS SDK Version
[debug] [iOS] iOS SDK Version set to 9.3
[debug] [iOS] Checking whether instruments supports our device string
[debug] [Instruments] Getting list of devices instruments supports
[debug] [Instruments] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instrument
[debug] [Instruments] Available devices: Apple TV 1080p (9.2) [A5FE6CCA-3A7B-4220-9AD3-DC0BCFB22CD8] (Simulator),iPad 2 (9.3) [EF4E9EC0-E008-4A26-A0B5-81E7E0C0ED16] (Simulator),iPad Air (9.3) [C3E8A5C6-8C4B-46A3-93FD-F9697A969001] (Simulator),iPad Air 2 (9.3) [A7AACD06-1D71-49B2-9283-B607462E944C] (Simulator),iPad Pro (9.3) [9503510E-C3A2-4E11-8E00-2038D79F1A56] (Simulator),iPad Retina (9.3) [1A4A82A7-1B3C-4E32-9C67-C4E857F28B7D] (Simulator),iPhone 4s (9.3) [FE282F1C-7AAB-453E-84F7-B5D9E7CC9685] (Simulator),iPhone 5 (9.3) [249EED76-F108-4266-B465-19A5128272E1] (Simulator),iPhone 5s (9.3) [4AB901CC-8A39-4B96-94A4-72DD2EBD6591] (Simulator),iPhone 6 (9.3) [78C5497B-EB06-46A9-87CE-331F2B99E10C] (Simulator),iPhone 6 Plus (9.3) [E357E070-2DB5-422B-B1A3-5583BE587212] (Simulator),iPhone 6s (9.3) [494FBF78-2165-4671-AE78-987D4D9E8DF3] (Simulator),iPhone 6s (9.3) + Apple Watch - 38mm (2.2) [E152E587-A30D-41B9-AF40-916E44E18907] (Simulator),iPhone 6s Plus (9.3) [95FC414D-98B8-4786-A47E-18F550456164] (Simulator),iPhone 6s Plus (9.3) + Apple Watch - 42mm (2.2) [16668096-3A92-4881-9A58-5F25AD517155] (Simulator)
[iOSSim] Retrieving device name string for Xcode version 7.3
[debug] [iOSSim] Getting device string from options: {"deviceName":"iPhone Simulator","platformVersion":"9.3","forceIphone":false,"forceIpad":false}
[debug] [iOSSim] Fixing device. Changed from 'iPhone Simulator' to 'iPhone 6 (9.3) ['
[debug] [iOSSim] Final device string is 'iPhone 6 (9.3) ['
[debug] [iOS] iOS sim UDID is 78C5497B-EB06-46A9-87CE-331F2B99E10C
[iOSSim] Constructing iOS simulator for Xcode version 7.3
[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-app-utils] Getting bundle ID from app
[Support] Error: Plist file doesn't exist: '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app/Info.plist'
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at Object.parsePlistFile$ (lib/plist.js:22:11)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
[Error: Plist file doesn't exist: '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app/Info.plist']
[ios-app-utils] Error: Could not extract Info.plist from application: Plist file doesn't exist: '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app/Info.plist'
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at extractPlist$ (lib/extract.js:14:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
[Error: Could not extract Info.plist from application: Plist file doesn't exist: '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app/Info.plist']
[iOS] Could not set the bundleId from app.
[MJSONWP] Encountered internal error running command: Error: Could not extract Info.plist from application: Plist file doesn't exist: '/Users/spoonitydev/workspace/Android-Test/src/Users/spoonitydev/Downloads/TestApp.app/Info.plist'
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at extractPlist$ (lib/extract.js:14:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
有没有人遇到过这个 appium 无法提取 Info.plist 文件的问题,即使它存在于 .app 文件中并且 xcrun 可以成功安装它?