手机已经安装 app 了,启动 app 时提示"Sdk '10.0.1' was not in list of simctl sdks" ,查看 log 也打印"Error: Unknown device or simulator UDID: '97f40d584156ff8847ebad19a691a375ed0773e1'",经排查手机的 UDID 是正确的,用 iTunes 可看到手机 UDID,识别手机。
capabilities.setCapability("xcodeConfigFile", "/usr/local/lib/xcode.xcconfig");
//capabilities.setCapability("autoAcceptAlerts",true);
capabilities.setCapability("deviceName", "iPhone");
capabilities.setCapability(MobileCapabilityType.UDID,ConfigProperty.get("serial"));
capabilities.setCapability("automationName", "XCUITest"); //字段必不可少哦
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", ConfigProperty.get("platformVersion")); //字段必不可少
capabilities.setCapability("bundleId", ConfigProperty.get("package")); //字段必不可少
//capabilities.setCapability("locationServicesAuthorized", true);
//capabilities.setCapability("appiumVersion", "1.7.1");
检查 deviceName 和 platformVersion 这两个字段值设置的是否正确
deviceName - iOS 设备名字
platformVersion - iOS 设备的操作系统版本
另外,推荐使用 libimobiledevice 工具
@ruru 能加下 QQ 吗?540409423,感谢
bundleId 是必须的吗?我也是这个问题 ,模拟器可以运行 ,真机一直识别不到
@ruru Open Application http://0.0.0.0:4723/wd/hub platformName=ios platformVersion=11.0 deviceName=iphone 6s app=users:/zhuolipu/desktop/HeiZhimaApp 提示 An unknown server-side error occurred while processing the command. Original error: Could not create simulator with name 'appiumTest-48dc374e-89b8-4660-a250-2c2372409fff', device type id 'iphone 6s' and runtime id '11.0.1'. Reason: 'simctl error running 'create': Invalid device type: iphone 6s ios 打开程序报错,我用的是 ios 的模拟器,求助大佬
我不是大佬,我三周之前才开始使用 appium, 但是你这个错误信息已经很明确:就是你的设备信息填写错误
Original error: Could not create simulator with name 'appiumTest-48dc374e-89b8-4660-a250-2c2372409fff', device type id 'iphone 6s' and runtime id '11.0.1'. Reason: 'simctl error running 'create': Invalid device type: iphone 6s ios
这段说的很明确了
怎么检查目前能够使用的设备: instruments -s devices;, 第一列:设备名字, 第二列: 操作系统版本, 第三列: udid
instruments -s devices;
Known Devices:
的iMac (4) [970D94F2-3ED8-512F-85B8-C66E7EB30986]
Apple TV (11.0) [03E31959-A7A4-4AD3-AF20-BEDB8900355B] (Simulator)
Apple TV 4K (11.0) [74D6125E-C8CC-4A61-84DA-18D3C55C2C2C] (Simulator)
Apple TV 4K (at 1080p) (11.0) [C2CC802D-26AA-4B6C-A71B-3B0C3E4E69ED] (Simulator)
Apple Watch - 38mm (4.0) [EBA95B0B-739E-47AE-B6B6-DEC4EE1DC807] (Simulator)
Apple Watch - 42mm (4.0) [235548EB-1DA9-4960-9602-D8F6537BA0BB] (Simulator)
iPad (5th generation) (11.0.1) [C86E2A78-044E-49D0-B23D-92A0ABBA91E5] (Simulator)
iPad Air (11.0.1) [8A6D8435-D548-4BBE-A436-250ECA87100F] (Simulator)
iPad Air 2 (11.0.1) [95E75941-6CF1-41C2-8EB2-EA06C5CDCBC0] (Simulator)
iPad Pro (10.5-inch) (11.0.1) [586B0DD8-BF51-4B31-B6B0-A4AA460D8780] (Simulator)
iPad Pro (12.9-inch) (11.0.1) [A6B7F67B-7852-438B-97C4-93107E63F38F] (Simulator)
iPad Pro (12.9-inch) (2nd generation) (11.0.1) [DA511AE2-BFD7-4E27-A6BA-6ED35401F09D] (Simulator)
iPad Pro (9.7-inch) (11.0.1) [DB5E083B-4849-4BA1-A6F3-307992BB722C] (Simulator)
iPhone 5s (11.0.1) [2AC7BF6C-A15A-463F-AF15-F32FF34025F2] (Simulator)
iPhone 6 (11.0.1) [7ED53934-94C7-4A9A-A86D-FC94A5868B4F] (Simulator)
iPhone 6 Plus (11.0.1) [24C5C48D-C043-4AAF-B701-91C90AC37791] (Simulator)
iPhone 6s (11.0.1) [717AD0D6-9E3C-4097-9474-DB395B95CDD6] (Simulator)
iPhone 6s Plus (11.0.1) [888EBA98-A7A8-4FD8-AC71-8EDC7EF7D763] (Simulator)
iPhone 7 (11.0.1) [D8539F0E-A744-45D7-AE45-9F56783434B0] (Simulator)
iPhone 7 (11.0.1) + Apple Watch Series 2 - 38mm (4.0) [A1BCAD41-2521-4317-ADE7-1DB129398008] (Simulator)
iPhone 7 Plus (11.0.1) [A56AE1AA-29A4-4F2F-ACF6-7E729AD66432] (Simulator)
iPhone 7 Plus (11.0.1) + Apple Watch Series 2 - 42mm (4.0) [F08ABE15-104C-495F-85B9-8889F08AA0FD] (Simulator)
iPhone 8 (11.0.1) [6EF7D949-B384-4559-90F8-84CA41229192] (Simulator)
iPhone 8 (11.0.1) + Apple Watch Series 3 - 38mm (4.0) [8E304CAC-3ABB-45B2-A631-225701FA76CD] (Simulator)
iPhone 8 Plus (11.0.1) [645E7E5D-3E2F-4324-8033-F2BC3427529A] (Simulator)
iPhone 8 Plus (11.0.1) + Apple Watch Series 3 - 42mm (4.0) [533CBC3C-B313-4A82-ACBE-9D681160BD90] (Simulator)
iPhone SE (11.0.1) [3D460F16-EBD6-483A-8B0D-8AAC539E6DF6] (Simulator)
iPhone X (11.0.1) [81317C27-FC9E-4E96-A975-5B20FE6385FB] (Simulator)
楼主的问题解决了吗?
mac$ instruments -s devices;
Known Devices:
lwj (12.0) [15b7dcdb1e6be6ca75ecded557bf4ab71566778a]
为什么还是不行?
UDID 要改成 udid