小编rea*_*n93的帖子

“操作无法完成。设备已分配,但卡在创建状态。” (外部设备上的 Xcode 13 iOS 模拟器)

为了节省我的(M1,2020)MacBook Pro(MYD82LL/A)内部驱动器上宝贵的 256GB 磁盘空间,我在安装 Xcode 后在 macOS 终端中运行了以下命令,以移动所有空间 -将组件占用到我格式化时命名为“Developer”的 2TB 外部驱动器中:

\n
sudo mv /Applications/Xcode.app /Volumes/Developer/Applications/Xcode.app && sudo ln -s /Volumes/Developer/Applications/Xcode.app /Applications/Xcode.app\nsudo mv ~/Library/Developer/CoreSimulator /Volumes/Developer/CoreSimulator && ln -s /Volumes/Developer/CoreSimulator ~/Library/Developer/CoreSimulator && sudo chown -R $USER:staff /Volumes/Developer/CoreSimulator\n
Run Code Online (Sandbox Code Playgroud)\n

尽管绝对确保 CoreSimulator 文件夹具有正确的所有权和权限(因此sudo chown -R $USER:staff /Volumes/Developer/CoreSimulator如上所述),但我在尝试模拟设备时仍然收到此错误(图像缩小,因为 2880x1800 Retina 分辨率会推高屏幕截图的文件大小)过去 2MB):

\n

错误消息的缩小屏幕截图

\n

更奇怪的是,我在 Xcode 中尝试执行此操作,同时还在tail -f ~/Library/Logs/CoreSimulator/CoreSimulator.log单独的终端窗口中运行。鉴于我确信(通过chown)确保我已经对移动的目录具有写访问权,因此生成的实时日志信息似乎违背逻辑:

\n
May  3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Warning>: Device BC4197AA-A5E9-4611-98B3-4C96B2CCD460 encountered in creation state at launch.  The device will be …
Run Code Online (Sandbox Code Playgroud)

ios ios-simulator swift apple-m1 xcode13

2
推荐指数
1
解决办法
3189
查看次数

警告:'int main(int, char***)' 的第二个参数应该是 'char **' [-Wmain](GNU C++ 编译器;Ubuntu 12.10)

尝试使用 C++ 克隆“yes”命令作为一个小实验(这是在 Ubuntu 12.10 上),这里有一个小问题:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>

using namespace std;

void yes (char* cmd[]) {
  if ( cmd != NULL ) {
    while (true) {
      cout << cmd[1] << endl;
    }
  } else {
    while (true) {
      cout << "y" << endl;
    }
  }
}

int main(int argc, char** argv[]) {
  yes(argv[1]);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

如果我保持原样,我会收到标题中描述的警告。如果我删除 argv 上的一个星号,我会收到关于将“char*”转换为“char**”的错误。并删除额外的功能(即把它全部放在 main 中,像这样):

int main(int argc, char** argv) {
  if ( argv != NULL …
Run Code Online (Sandbox Code Playgroud)

c++ gcc ubuntu-12.10

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

apple-m1 ×1

c++ ×1

gcc ×1

ios ×1

ios-simulator ×1

swift ×1

ubuntu-12.10 ×1

xcode13 ×1