jua*_*cia 9 ios react-native xcode8
在以下环境中:
Xcode 8.3.2
react-native-cli 2.0.1
react-native: 0.44.0
macOS Sierra 10.12.5
Run Code Online (Sandbox Code Playgroud)
刚刚更新了Xcode和macOS以运行React Native并像我几天前一样继续练习...但是每次我尝试运行时:
react-native run-ios
Run Code Online (Sandbox Code Playgroud)
我得到错误:
Scanning 555 folders for symlinks in /Users/juangarcia/projects/react-tests/CountDown/node_modules (6ms)
Found Xcode project CountDown.xcodeproj
Could not find iPhone 6 simulator
Run Code Online (Sandbox Code Playgroud)
我尝试查看可用设备的列表,然后得到:
~/projects/react-tests/CountDownSample » xcrun simctl list devices
== Devices ==
-- iOS 10.3 --
-- tvOS 10.2 --
Apple TV 1080p (323FA90C-0366-4B5B-AEEE-D0477C61762A) (Shutdown)
-- watchOS 3.2 --
Apple Watch - 38mm (F42C0C0D-325B-41DD-948D-E44B0A08B951) (Shutdown)
Apple Watch - 42mm (75D8BAF1-27CB-47EE-9EE3-D400B962F8BC) (Shutdown)
Apple Watch Series 2 - 38mm (64D01BD4-5C37-4885-A73A-52479D9CCF4F) (Shutdown)
Apple Watch Series 2 - 42mm (8471C9FD-BCF3-4DDC-B386-F17E128C5EB1) (Shutdown)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-9-3 --
iPhone 4s (1FF2D0D3-F136-43A7-8148-7B1849A7B1E3) (Shutdown) (unavailable, runtime profile not found)
iPhone 5 (859D4D90-F1B5-4DE8-B976-6984F85CAFE3) (Shutdown) (unavailable, runtime profile not found)
iPhone 5s (5B2AD8CD-9B3F-413C-BF16-FA96F807BB2B) (Shutdown) (unavailable, runtime profile not found)
iPhone 6 (2573D214-4371-47A8-BFF6-3341862954E0) (Shutdown) (unavailable, runtime profile not found)
iPhone 6 Plus (8916CD9B-4D8B-463F-8583-75A2CE4F61FD) (Shutdown) (unavailable, runtime profile not found)
iPhone 6s (41093980-7912-4F98-9D06-981A533FAAFE) (Shutdown) (unavailable, runtime profile not found)
iPhone 6s Plus (6A85D2AE-D867-4341-979C-FEE8308DE93E) (Shutdown) (unavailable, runtime profile not found)
iPad 2 (BFBB5477-B6D9-48C3-B529-516D2D9105A7) (Shutdown) (unavailable, runtime profile not found)
iPad Retina (C49B5920-F4FF-4D7F-AA74-7AE2367FF09D) (Shutdown) (unavailable, runtime profile not found)
iPad Air (4101FC8E-D8B9-4496-AD2B-1484661C15DE) (Shutdown) (unavailable, runtime profile not found)
iPad Air 2 (9952B05C-829F-428F-AC76-EB1F8FB55D72) (Shutdown) (unavailable, runtime profile not found)
iPad Pro (735082E2-4470-4D9A-BAA1-BEDA8426B725) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.tvOS-9-2 --
Apple TV 1080p (AD48DE24-6295-4EFC-9787-A9B5D8118503) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.watchOS-2-2 --
Apple Watch - 38mm (C3F2A7C3-3967-4159-9B79-13CBA63E399E) (Shutdown) (unavailable, runtime profile not found)
Apple Watch - 42mm (656005A9-7555-4872-A7FB-FB6BCB65139C) (Shutdown) (unavailable, runtime profile not found)
Run Code Online (Sandbox Code Playgroud)
默认情况下,react需要使用Iphone 6进行操作,并且该功能不可用
我如何才能再次使用它?为什么会这样呢?
pfff 它比预期的要简单...安装 SO 和 Xcode 时,由于某种原因,整个设备列表都被删除了...转到 Xcode UI 菜单,在本例中添加一个新的模拟器 iPhone 6 就足够了...我尝试过重新启动并返回,等等,因为我是 XCode 环境的新手,所以不知道 UI 中有一个选项。谢谢你的答案。
在 XCode 菜单中,窗口 --> 设备 --> 添加新模拟器...
特尔;博士:
使用 xcrun simctl upgrade
细节:
在xcrun simctl delete unavailable
安装了 Xcode 10 和 Xcode 11(以及当前处于活动状态的 Xcode 10)后,我可能处于这种情况。
执行xcrun simctl list runtimes
我发现列出的 iOS 13.1 运行时:
iOS 11.4 (11.4 - 15F79) - com.apple.CoreSimulator.SimRuntime.iOS-11-4
iOS 13.1 (13.1 - 17A844) - com.apple.CoreSimulator.SimRuntime.iOS-13-1
tvOS 13.0 (13.0 - 17J585) - com.apple.CoreSimulator.SimRuntime.tvOS-13-0
watchOS 6.0 (6.0 - 17R575) - com.apple.CoreSimulator.SimRuntime.watchOS-6-0
Run Code Online (Sandbox Code Playgroud)
但是当我执行时xcrun simctl list
,几个模拟器被列为不可用:
iPhone 8 Plus (B08025C1-B7A2-40C0-B6D5-517EC8BB3C45) (Shutdown) (unavailable, runtime profile not found)
iPhone Xs (0A1C1EAA-8E18-4508-9E14-C376D944984B) (Shutdown) (unavailable, runtime profile not found)
iPhone Xs Max (84C692F5-6CF3-449D-B166-0EA26B1FAC4B) (Shutdown) (unavailable, runtime profile not found)
iPhone X? (7581E116-5CFB-4A94-94A0-30B5B8871874) (Shutdown) (unavailable, runtime profile not found)
Run Code Online (Sandbox Code Playgroud)
我的解决方案是将不可用的模拟器升级到所需的 iOS 运行时(在我的情况下为 iOS 13.1):
xcrun simctl upgrade SIMULATOR_ID "com.apple.CoreSimulator.SimRuntime.iOS-13-1"
为了避免必须为所有模拟器手动执行此操作,我编写了这个小的 ruby 脚本来一次升级所有 iPhone:
#!/usr/bin/ruby
uuid_regex = /([0-9A-Z]{8}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{12})/
unavailable_iPhones = `xcrun simctl list | grep iPhone | grep "runtime profile not found"`.split("\n")
unavailable_iPhones.each do | row |
uuid = row.match(uuid_regex).captures.first
system("xcrun simctl upgrade #{uuid} \"com.apple.CoreSimulator.SimRuntime.iOS-13-1\"")
end
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5017 次 |
最近记录: |