【问题标题】:Is there anyway to get the UDID of a booted simulator in mac via terminal无论如何通过终端在mac中获取启动模拟器的UDID
【发布时间】:2019-09-11 06:25:06
【问题描述】:

尝试为不同的 Ipad 模拟器启动 Appium 服务器,但是当我使用以下命令时

xcrun simctl list | egrep '(Booted)'

我得到了引导模拟器的完整细节

iPad (5th generation) (1D9E3D9C-7715-4742-A9DC-6096BCE95B64) (Booted) 

有没有办法只获取已启动的模拟器的UDID

【问题讨论】:

    标签: appium-ios


    【解决方案1】:

    这对我有用:

    xcrun simctl list devices | grep "(Booted)" | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})"
    

    【讨论】:

      【解决方案2】:

      也许可以尝试使用awk 或等效的方法来获取UDID 信息:

      xcrun simctl list | awk -F'[()]' '/(Booted)/ { print $4 }'
      

      您可能需要调整输出字段的数字(因此可能是$4,而不是$3,等等)

      【讨论】:

      • 谢谢它的工作,我想要只需要将它更改为 4 美元你能告诉我在哪里可以找到东西的网站
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-09
      • 1970-01-01
      • 2017-05-14
      相关资源
      最近更新 更多