gpt4 book ai didi

ios - react-native run-ios 在连接到 iOS 模拟器时遇到问题

转载 作者:行者123 更新时间:2023-11-28 19:32:08 25 4
gpt4 key购买 nike

我在 iOS 模拟器上运行我的 react-native 应用程序时遇到问题。它在我的 Windows 机器上的 Android 模拟器上运行良好,所以我很确定它与我自己的代码无关。

这个问题似乎与权限有关。

如果我以我的用户(不是 root)身份运行 react-native run-ios 和模拟器,它似乎发现模拟器很好,但我在构建过程中遇到错误:

 2017-03-12 14:22:05.656 xcodebuild[2612:76143] couldn't read dependency graph from '/Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/yoga.build/dgph': Permission denied

2017-03-12 14:22:05.677 xcodebuild[2612:76144] couldn't read dependency graph from '/Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/jschelpers.build/dgph': Permission denied

2017-03-12 14:22:05.677 xcodebuild[2612:76143] unable to create temporary file at /Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/yoga.build/dgph-1BUDub2D: Permission denied

2017-03-12 14:22:05.677 xcodebuild[2612:76144] unable to create temporary file at /Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/jschelpers.build/dgph-pZNRO08O: Permission denied

2017-03-12 14:22:05.679 xcodebuild[2612:76144] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-11758/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/DependencyGraph/XCDependencyGraph.mm:688
Details: unable to write dependency graph: Permission denied
Object: <XCDependencyGraph>
Method: +loadOrCreateInBuildDirectory:withTargetBuildContext:withBasePath:
Thread: <NSThread: 0x7facda2f3090>{number = 9, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
2017-03-12 14:22:05.679 xcodebuild[2612:76143] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-11758/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/DependencyGraph/XCDependencyGraph.mm:688
Details: unable to write dependency graph: Permission denied
Object: <XCDependencyGraph>
Method: +loadOrCreateInBuildDirectory:withTargetBuildContext:withBasePath:
Thread: <NSThread: 0x7facd9f73a90>{number = 8, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

Build Preparation

Couldn't create workspace arena folder '/Users/jordan/src/anxiety-work-tracker/ios/build': Unable to write to info file '<DVTFilePath:0x7facd9e06ec0:'/Users/jordan/src/anxiety-work-tracker/ios/build/info.plist'>'.

Couldn't update module cache session file '/Users/jordan/src/anxiety-work-tracker/ios/build/ModuleCache/Session.modulevalidation': You don’t have permission to save the file “Session.modulevalidation” in the folder “ModuleCache”.



** BUILD FAILED **

然后模拟器确实加载了应用程序,但有一个错误提示它无法从模块缓存中加载。

如果我以 root 身份运行 react-native run-ios 并以我的用户身份运行 Simluator,它会说找不到正在运行的模拟设备。

如果我以 root 身份运行两者,则在运行 react-native run-ios 时会得到以下信息:

** BUILD SUCCEEDED **


Installing build/Build/Products/Debug-iphonesimulator/AnxietyWorkTracker.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):
Unable to lookup service com.apple.CoreSimulator.host_support: 0x44e
Launching org.reactjs.native.example.AnxietyWorkTracker
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):
Unable to lookup service com.apple.CoreSimulator.host_support: 0x44e

模拟器不加载任何东西。

更新

根据 Rob 的评论,我更改了目录的权限/所有者。

sudo chown -R <username> <srcPath>

这允许构建以我的非根用户身份成功运行。运行 react-native run-ios 但是构建,打开模拟器,在模拟器中打开应用程序,然后产生此错误:

react-native run-ios error

最佳答案

我知道我在 OP 的更新中添加了这个,但我希望这个 SO 问题被标记为已回答,因为它已经被回答了。

根据 Rob 的评论,问题是对我的源目录的权限。

sudo chown -R <username> ~/src/<project-dir-name>

关于ios - react-native run-ios 在连接到 iOS 模拟器时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42753606/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com