最近问我关于 Appium inspector 不能打开的人有点多,所以开一个贴来回答下。首先肯定是你打飞机的方式不对。
先说下我的环境:
(Original error: Could not find a device to launch. You requested 'iPhone (9.0 Simulator)', but the available devices were: [\"iPad 2 (9.0) [031234AD-E5F7-43C9-96FA-B17102BDA639]\",\"iPad Air (9.0) [6D42D419-3A5B-4AEE-84FA-0A7A6399BDFB]\",\"iPad Air 2 (9.0) [0E8DD9FF-74E8-41C5-A9DF-0686D8928E33]\",\"iPad Retina (9.0) [28B9D67C-C4A1-494F-9050-530131273A4F]\",\"iPhone 4s (9.0) [ED0646AF-6D55-4098-A2DC-357F4388C046]\",\"iPhone 5 (9.0) [DE374BB7-4C31-4B6C-935E-25C91758F149]\",\"iPhone 5s (9.0) [2F6D313C-5229-478C-8718-12EF0D2B5D76]\",\"iPhone 6 (9.0) [A8A2985F-4415-4315-A667-6BD15AAAC187]\",\"iPhone 6 (9.0) + Apple Watch - 38mm (2.0) [E6870A9B-5002-415C-AA5C-A922AED64D4E]\",\"iPhone 6 Plus (9.0) [EE370519-F66A-46C5-AF1C-6E76ABDD0521]\",\"iPhone 6 Plus (9.0) + Apple Watch - 42mm (2.0) [7DEE837E-8C50-4A47-978B-9591972CD367]\",\"iPhone 6s (9.0) [D4EFCB49-E6D0-482E-A490-952E834EBC98]\",\"iPhone 6s Plus (9.0) [34887784-FECA-4C50-B208-A18272365B32]\"])","origValue":"Could not find a device to launch. You requested 'iPhone (9.0 Simulator)', but the available devices were: [\"iPad 2 (9.0) [031234AD-E5F7-43C9-96FA-B17102BDA639]\",\"iPad Air (9.0) [6D42D419-3A5B-4AEE-84FA-0A7A6399BDFB]\",\"iPad Air 2 (9.0) [0E8DD9FF-74E8-41C5-A9DF-0686D8928E33]\",\"iPad Retina (9.0) [28B9D67C-C4A1-494F-9050-530131273A4F]\",\"iPhone 4s (9.0) [ED0646AF-6D55-4098-A2DC-357F4388C046]\",\"iPhone 5 (9.0) [DE374BB7-4C31-4B6C-935E-25C91758F149]\",\"iPhone 5s (9.0) [2F6D313C-5229-478C-8718-12EF0D2B5D76]\",\"iPhone 6 (9.0) [A8A2985F-4415-4315-A667-6BD15AAAC187]\",\"iPhone 6 (9.0) + Apple Watch - 38mm (2.0) [E6870A9B-5002-415C-AA5C-A922AED64D4E]\",\"iPhone 6 Plus (9.0) [EE370519-F66A-46C5-AF1C-6E76ABDD0521]\",\"iPhone 6 Plus (9.0) + Apple Watch - 42mm (2.0) [7DEE837E-8C50-4A47-978B-9591972CD367]\",\"iPhone 6s (9.0) [D4EFCB49-E6D0-482E-A490-952E834EBC98]\",\"iPhone 6s Plus (9.0) [34887784-FECA-4C50-B208-A18272365B32]\"]"},"sessionId":null}
很多人不看日志,看不懂英文。其实很简单吗,You requested 'iPhone (9.0 Simulator)'
你要的是 iPhone (9.0 Simulator),但是只有后面那一堆。怎么办呢?自己造一个。
打开 xcode 的设备:
根据自己想要的名字建立一个:
如果是 iPhone (9.0 Simulator),那么 appium 对应的配置就是:
那可是个输入框,输入框,输入框!
[INST STDERR] dyld: could not load inserted library '/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib' because no suitable image found.
这是什么鬼?科学上网就能解决啊。https://github.com/appium/appium/issues/5720
Currently Instruments-Without-Delay does not work with iOS 9+. We are working on a fix for this.
In order to run the server without this shim, in "Developer Settings" add a "Custom Server Flag" --native-instruments-lib before launching the server.
于是:
设置好,启动起来!
我是这样的配置
启动好后,