xcode 控制台报错信息:
dyld:Librarynotloaded:@rpath/libswiftCore.dylibReferencedfrom:/var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/Stylist.app/StylistReason:nosuitable image found.Didfind:/private/var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/testapp.app/Frameworks/libswiftCore.dylib:mmap()errno=1validating first page of'/private/var/mobile/Containers/Bundle/Application/3FC2DC5C-A908-42C4-8508-1320E01E0D5B/testapp.app/Frameworks/libswiftCore.dylib'(lldb)
解决方案:
进入终端:
1. rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
2. rm -rf ~/Library/Developer/Xcode/DerivedData
3. rm-rf~/Library/Caches/com.apple.dt.Xcode
执行完毕
command + R;
注意:有可能因为机器不同,出现找不到目录的问题,
getconf DARWIN_USER_CACHE_DIR:找到用户缓存目录
可以收到找到缓存目录:
终端执行:getconf DARWIN_USER_CACHE_DIR
结果:/var/folders/29/jr9rplt50cb_yk7kqhhyn_th0000gn/C/
然后cd到org.llvm.clang/ModuleCache;
手动 rm -rf;