我正在尝试使用Appium对我的IOS应用程序进行一些测试。 (这是我第一次使用它)。我正在使用Appium Desktop启动Appium。这是我的能力清单:
{
"platformName": "iOS",
"platformVersion": "11.2",
"deviceName": "iPhone 7 Plus",
"automationName": "XCUITest",
"app": "/Users/me/Library/Developer/Xcode/DerivedData/MyApp/Build/Products/Debug-iphoneos/MyApp.app",
"noReset": true,
"showIOSLog": true
}
当我开始会话时,在日志中,我看到Appium正在使用UUID B068A9B1-62CF-4E28-A9DA-E7C7C8EEF8DC启动IOS模拟器。以下是相关的日志行:
[debug] [iOSSim]运行模拟器UI客户端实例的计数 是0
[iOSSim]使用UDID启动模拟器 B068A9B1-62CF-4E28-A9DA-E7C7C8EEF8DC ...
[iOSSim]使用命令启动Simulator UI:open -Fn /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID B068A9B1-62CF-4E28-A9DA-E7C7C8EEF8DC -ConnectHardwareKeyboard 1
[iOSSim]模拟器,带UDID B068A9B1-62CF-4E28-A9DA-E7C7C8EEF8DC 在67秒内启动
根据该日志,UUID以 B068A9B1-62CF-4E28-A9DA-E7C7C8EEF8DC 给出。但是,当我输入终端窗口时:
xcrun simctl list
我得到的清单如下:
== Devices ==
-- iOS 11.2 --
iPhone 5s (46A12989-6F7E-459D-A566-347883681981) (Shutdown)
iPhone 6 (429F8EB3-E8C6-4EE6-8313-17E6FBE98BB2) (Shutdown)
iPhone 6 Plus (2EB7ADC5-47F7-46DD-92A2-043D8CD36764) (Shutdown)
iPhone 6s (FDE95542-48A8-4C7E-A983-84D0747AF5B6) (Shutdown)
iPhone 6s Plus (25008979-F6E4-42F6-B5A0-28ED4D872E85) (Shutdown)
iPhone 7 (DBD96A0C-B1D7-4FA6-8DE4-CBE741859341) (Shutdown)
iPhone 7 Plus (2D65A1C5-CA42-4808-B60A-C7805DFE0D02) (Shutdown)
iPhone 8 (781339FA-7397-455C-8EB1-5D116381ACD6) (Shutdown)
iPhone 8 Plus (22C4CA50-57CD-4D03-A9DB-5A7E8CED337C) (Shutdown)
iPhone SE (EA7C6EE8-D177-4FA0-AD6C-2AC3FA1ABB74) (Shutdown)
iPhone X (359B77C6-0559-4FF6-83E3-E815A5EBA1C5) (Booted)
iPad Air (3DFF4AE2-3867-4E18-92D6-6086B5909FCC) (Shutdown)
iPad Air 2 (AED4735B-8771-494E-9F80-A2A8F8EE09E8) (Shutdown)
iPad (5th generation) (9094F6EE-4190-4028-9596-EAC994CEC44E) (Shutdown)
iPad Pro (9.7-inch) (59A04DFC-48BC-4302-A824-0F6F2C818650) (Shutdown)
iPad Pro (12.9-inch) (42446801-ED81-4A7E-992B-FC1DB96CCEFA) (Shutdown)
iPad Pro (12.9-inch) (2nd generation) (1C95389C-3508-4998-A770-AC02DE6C6797) (Shutdown)
iPad Pro (10.5-inch) (7FD67BA5-C826-4CB5-BA7B-BB1F1B7B0B0F) (Shutdown)
-- tvOS 11.2 --
Apple TV (AC8B4DA3-286E-4507-8FBB-D358EAC8E607) (Shutdown)
Apple TV 4K (4E8B99D7-D07B-4ECF-8E07-EAD5D799929C) (Shutdown)
Apple TV 4K (at 1080p) (9510E577-B71D-4D24-BA10-0B5E079F4DAB) (Shutdown)
-- watchOS 4.2 --
Apple Watch - 38mm (36E860BC-4DF3-413C-90C4-71FB2813B13D) (Shutdown)
Apple Watch - 42mm (A8408CA5-99C3-4F0E-B571-7509703B2FE0) (Shutdown)
Apple Watch Series 2 - 38mm (19BAAC48-A69C-4D5B-A921-7008C76CA3C5) (Shutdown)
Apple Watch Series 2 - 42mm (0CA6DA87-4BBE-44AF-8B82-C652CA3D80CC) (Shutdown)
Apple Watch Series 3 - 38mm (5515A207-88C3-4752-82A2-E99F5B7C8532) (Shutdown)
Apple Watch Series 3 - 42mm (9532F5BC-DAA0-4CC0-A544-D26A6EC9F9AD) (Shutdown)
== Device Pairs ==
AE5E48FE-EFBD-4FF9-851E-861ED3FF2002 (active, disconnected)
Watch: Apple Watch Series 2 - 38mm (19BAAC48-A69C-4D5B-A921-7008C76CA3C5) (Shutdown)
Phone: iPhone 7 (DBD96A0C-B1D7-4FA6-8DE4-CBE741859341) (Shutdown)
64C97089-7FB9-4CC3-986C-7B3F56D982CC (active, disconnected)
Watch: Apple Watch Series 2 - 42mm (0CA6DA87-4BBE-44AF-8B82-C652CA3D80CC) (Shutdown)
Phone: iPhone 7 Plus (2D65A1C5-CA42-4808-B60A-C7805DFE0D02) (Shutdown)
10141E88-D1D8-4BF7-A665-59A6EB10F8A9 (active, disconnected)
Watch: Apple Watch Series 3 - 38mm (5515A207-88C3-4752-82A2-E99F5B7C8532) (Shutdown)
Phone: iPhone 8 (781339FA-7397-455C-8EB1-5D116381ACD6) (Shutdown)
9ED5EC88-726E-46CE-A7C9-5849613ABAFA (active, disconnected)
Watch: Apple Watch Series 3 - 42mm (9532F5BC-DAA0-4CC0-A544-D26A6EC9F9AD) (Shutdown)
Phone: iPhone 8 Plus (22C4CA50-57CD-4D03-A9DB-5A7E8CED337C) (Shutdown)
如您所见,没有匹配UUID的此类设备。
更有趣的是,Appium认为我的应用已安装到此设备上,位于日志中:
[debug] [XCUITest] App' com。****。**********'已安装。无需重新安装。
但是,当我查看打开的模拟器屏幕时,我根本看不到我的应用程序。
我的问题是:
任何见解都将受到赞赏。谢谢。
答案 0 :(得分:1)
事实证明这比我原先想象的要简单。我想分享我在这里找到的东西,以便其他可能被同样的错误所困扰的人不会浪费他们的时间。
当我试图让Appium工作时,作为解决我面临的一个障碍的解决方案,有人建议用sudo启动Appium。所以我一直在使用:
sudo ./Appium
启动它。
这显然是错误的。不要用sudo启动Appium!
如果你不这样做,那就像魔法一样。
从这次经历中吸取的教训: