7

Xcode 7 ベータ版をインストールして、Swift プロジェクトを Swift 2 ガイドラインに変換しました。

Build is OK but xcassets: ログに次のエラーが表示されました:

CompileAssetCatalog /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Products/Debug-iphoneos/{...}.app {...}/Images.xcassets
cd /Users/phoenix/Dev/Xcode/{...}
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/usr/bin/actool --output-format human-readable-text\
    --notices --warnings --export-dependency-info /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Intermediates/{...}.build/Debug-iphoneos/{...}.build/assetcatalog_dependencies.txt
    --output-partial-info-plist /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Intermediates/{...}.build/Debug-iphoneos/{...}.build/assetcatalog_generated_info.plist\
    --app-icon AppIcon --launch-image LaunchImage --compress-pngs\
    --enable-on-demand-resources YES --target-device iphone --target-device ipad\
    --minimum-deployment-target 7.0 --platform iphoneos --compile\
    /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Products/Debug-iphoneos/{...}.app\
    /Users/phoenix/Dev/Xcode/{...}/Images.xcassets
/Users/phoenix/Dev/Xcode/{...}/Images.xcassets: error:
    Failed to find a suitable device for the type SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-2 with runtime SimRuntime :
    9.0 (13A4254u) - com.apple.CoreSimulator.SimRuntime.iOS-9-0
Failure Reason: Failed to create new simulator device that matches SimDeviceType :
    com.apple.CoreSimulator.SimDeviceType.iPad-2 for runtime SimRuntime :
    9.0 (13A4254u) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 ((null))

UPD: ドックの [開発者ツールを開く] メニューから iOS シミュレーターを起動しようとすると、次のエラーが発生します。

Dyld Error Message:
Library not loaded:
    @rpath/SimulatorKit.framework/Versions/A/SimulatorKit
Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Conte‌​nts/MacOS/Simulator
Reason: image not found

UPD2: ターミナルからシミュレーターを起動しようとすると、警告が表示されました:

$ Applications/Simulator.app/Contents/MacOS/Simulator 
dyld: warning, LC_RPATH @loader_path/../../../../Library/PrivateFrameworks in /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator being ignored in restricted program because of @loader_path
dyld: Library not loaded: @rpath/SimulatorKit.framework/Versions/A/SimulatorKit
  Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
  Reason: image not found

これが本題だと思いますが…

4

3 に答える 3

8

に移動し~/Library/Developer/CoreSimulator/Profiles/Runtimes、ランタイムを削除します - ランタイムは古いです。その後、Xcode7 を再起動し、シミュレーターを起動します...

@seancookからの詳細な説明:

私もエルキャピタンでこれを経験しました。NIB がロードされず、Sim が存在せず、Xcode/Open Developer Tool/Simulator メニューからシミュレーターを起動できませんでした。数時間格闘した後、ようやく動作するようになりました。

これが私にとってうまくいったことです(YMMV):コード署名されていないシミュレータランタイムの行に沿ってConsole.appにメッセージがあることに気付きました。「/Library/Developer/CoreSimulator/Profiles/Runtimes」と記述されているパスに移動し、そこにあったランタイムを削除しました。それらは古いランタイムだったので、以前は適用されなかった Xcode のチェックが適用されるようになったと思います。知るか?

これを行った後、最終的に Xcode/Open Developer Tool メニューからシミュレーターを起動できました。残念ながら、シミュレーターはまだ私のワークスペースで実行ターゲットとして表示されていなかったので、私は探検を続けました...

次に、シミュレーターのハードウェア/デバイス/デバイスの管理メニューに移動し、新しい iOS9 デバイスを追加しました。何もしないようだったので、Xcode と Simulator.app をやめました。次に、Simulator.app を (Xcode/ODT/Simulator 経由で) 再起動すると、予想される iOS9 シミュレーターが表示されました。Xcode を閉じて再度開き、プロジェクトのターゲット OS を変更したところ、最終的に Sims が実行ターゲットとして表示されました。

于 2015-08-17T05:53:23.977 に答える