xcode npm install -g ios-deploy 不起作用,它显示错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51455401/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:42:38  来源:igfitidea点击:

npm install -g ios-deploy didn't work , it displays error

iosxcodenpmhomebrewappium-ios

提问by Girish

I am trying to install APPIUM on my machine and want to run it in actual device, for that i have to install the command 'npm install -g ios-deploy' but when i am trying to install it is dispalying the error.

我正在尝试在我的机器上安装 APPIUM 并希望在实际设备上运行它,为此我必须安装命令“npm install -g ios-deploy”,但是当我尝试安装它时显示错误。

Error:

错误:

he following build commands failed: PhaseScriptExecution Run\ Script build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh

以下构建命令失败:PhaseScriptExecution Run\ Script build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh

(1 failure) npm ERR! code ELIFECYCLE npm ERR! errno 65 npm ERR! [email protected] preinstall: ./src/scripts/check_reqs.js && xcodebuildnpm ERR! Exit status 65 npm ERR! npm ERR! Failed at the [email protected] preinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

(1 次失败) npm ERR!代码 ELIFECYCLE npm ERR!错误号 65 npm 错误号![email protected] 预安装:./src/scripts/check_reqs.js && xcodebuildnpm ERR!退出状态 65 npm ERR!npm 错误![email protected] 预安装脚本失败。npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。

npm ERR! A complete log of this run can be found in: npm ERR! /Users/synerzip/.npm/_logs/2018-07-21T10_30_21_090Z-debug.log syn-macmini-03:~ synerzip$ xcodebuild xcodebuild: error: The directory /Users/synerzip does not contain an Xcode project.

npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!/Users/synerzip/.npm/_logs/2018-07-21T10_30_21_090Z-debug.log syn-macmini-03:~ synerzip$ xcodebuild xcodebuild: 错误:目录/Users/synerzip 不包含Xcode 项目。

Solution Tried:

尝试的解决方案:

  1. sudo npm install -g ios-deploy
  2. npm install -g ios-deploy --unsafe-perm=true
  3. npm install -g ios-deploy --allow-root
  1. 须藤 npm install -g ios-deploy
  2. npm install -g ios-deploy --unsafe-perm=true
  3. npm install -g ios-deploy --allow-root

Details:

细节:

OS: 1.13.6

操作系统:1.13.6

xcode version: 9.4.1

xcode 版本:9.4.1

node version: v10.7.0

节点版本:v10.7.0

Notewhen i run the command 'xcode-select --print-path' following path display, "/Applications/Xcode.app/Contents/Developer"

请注意,当我在路径显示后运行命令“xcode-select --print-path”时,“/Applications/Xcode.app/Contents/Developer”

Can Any help me on this.

任何人都可以帮助我。

Thanks.

谢谢。

回答by Girish

I have tried the following steps sequentially and it works for me.

我已按顺序尝试了以下步骤,它对我有用。

  1. sudo npm uninstall -g ios-deploy
  2. brew install ios-deploy
  1. 须藤 npm 卸载 -g ios-deploy
  2. brew install ios-deploy

@Paul - Thanks for looking in it.

@Paul - 感谢您查看它。

回答by Paul Hoffmann

I could fix the problem by installing the "Xcode 10 beta 4" on my computer. Another solution is provided on GitHub - check out the following links.

我可以通过在我的电脑上安装“Xcode 10 beta 4”来解决这个问题。GitHub 上提供了另一种解决方案 - 查看以下链接。

回答by Emre Gürses

After the below command

在以下命令之后

$ npm uninstall -g ios-deploy

You should restart your command line. And than you can run below line on command line.

您应该重新启动命令行。然后你可以在命令行下运行。

$ brew upgrade ios-deploy

回答by Parag Shinde

I have Fixed it with following STEPS... (Ignore steps if you have already done it)

我已经按照以下步骤修复了它......(如果你已经完成了,请忽略步骤)

Debug on real iOS device iONIC App

在真实的 iOS 设备 iONIC App 上调试

  1. Install brew( with command on terminal ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”)

  2. Install Xcode

  3. Run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

  4. Install iOS-deploy (brew install ios-deploy)

  5. Build iOS with ionic cordova build ios --buildFlag="-UseModernBuildSystem=0"

  6. Go to Xcode and set provisioning profile certificate

  7. Attach device and run command on terminal ionic cordova run ios --buildFlag="-UseModernBuildSystem=0"

  8. First it will fail as you need to Go to setting—>General -.>Device management->Click on your development certificate->Trust.

  9. Done now you can run your ionic app on your real iOS device directly with just ionic cordova run ios --buildFlag="-UseModernBuildSystem=0"

  1. 安装 brew(在终端上使用命令 ruby​​ -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”)

  2. 安装 Xcode

  3. 运行 sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

  4. 安装 iOS-deploy (brew install ios-deploy)

  5. 使用 ionic cordova build ios --buildFlag="-UseModernBuildSystem=0" 构建 iOS

  6. 转到 Xcode 并设置配置文件证书

  7. 附加设备并在终端上运行命令 ionic cordova run ios --buildFlag="-UseModernBuildSystem=0"

  8. 首先它会失败,因为您需要转到设置->常规-.>设备管理->单击您的开发证书->信任。

  9. 现在完成了,您可以直接在真正的 iOS 设备上运行您的 ionic 应用程序,只需 ionic cordova run ios --buildFlag="-UseModernBuildSystem=0"

Cheers!!!!!!!!!

干杯!!!!!!!!!

回答by Gabe

To use ios-deploy as a command-line tool it is recommended you now install it directly via Homebrew(and if you have already installed it via npm to uninstall it).

要使用 ios-deploy 作为命令行工具,建议您现在直接通过 Homebrew 安装它(如果您已经通过 npm 安装了它以卸载它)。

https://github.com/ios-control/ios-deploy#installation

https://github.com/ios-control/ios-deploy#installation

The Homebrew and npm versions will be updated at the same time going forward.

Homebrew 和 npm 版本将在未来同时更新。