Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ios-deploy install doesn't work #346

Closed
5 of 6 tasks
vinigabriel opened this issue Jun 20, 2018 · 45 comments
Closed
5 of 6 tasks

Ios-deploy install doesn't work #346

vinigabriel opened this issue Jun 20, 2018 · 45 comments
Labels
Milestone

Comments

@vinigabriel
Copy link

vinigabriel commented Jun 20, 2018

Hi,

Command line arguments than I used for ios-deploy.

sudo npm install -g ios-deploy --unsafe-perm --allow-root

Expected behavior

Install ios-deploy global via NPM

Actual behavior.

Ios-deploy not installed and get the error 65:

/bin/sh -c /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
cp: /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices: No such file or directory

** BUILD FAILED **

The following build commands failed:
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 && xcodebuild
npm 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.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/vinicius/.npm/_logs/2018-06-20T10_50_13_426Z-debug.log

Steps to reproduce the problem

I run the command: npm install -g ios-deploy

System Specs

  • 1. system_profiler SPSoftwareDataType
    System Version: macOS 10.13.5 (17F77)
    Kernel Version: Darwin 17.6.0
    Boot Volume: Macintosh HD
    Boot Mode: Normal
    Computer Name: Mac mini de Vinicius
    User Name: Vinicius Ribeiro (vinicius)
    Secure Virtual Memory: Enabled
    System Integrity Protection: Enabled
    Time since boot: 36 minutes
  • 2. ios-deploy -V
    -bash: ios-deploy: command not found
  • 3. xcodebuild -version
    Xcode 9.4.1
    Build version 9F2000
  • 4. xcode-select --print-path
    /Applications/Xcode.app/Contents/Developer
  • 5. gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 9.1.0 (clang-902.0.39.2)
    Target: x86_64-apple-darwin17.6.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • 6. lldb --version
    lldb-902.0.79.7
    Swift-4.1
@vinigabriel
Copy link
Author

This is the log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.4.1/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'ios-deploy',
1 verbose cli '--unsafe-perm',
1 verbose cli '--allow-root' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 9f8de42997660956
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/ios-deploy 260ms (from cache)
8 silly pacote tag manifest for ios-deploy@latest fetched in 281ms
9 timing stage:loadCurrentTree Completed in 453ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule [email protected] checking installable status
17 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 5ms
18 timing stage:loadIdealTree Completed in 7ms
19 silly currentTree lib
20 silly idealTree lib
20 silly idealTree └── [email protected]
21 silly install generateActionsToTake
22 timing stage:generateActionsToTake Completed in 4ms
23 silly diffTrees action count 1
24 silly diffTrees add [email protected]
25 silly decomposeActions action count 8
26 silly decomposeActions fetch [email protected]
27 silly decomposeActions extract [email protected]
28 silly decomposeActions preinstall [email protected]
29 silly decomposeActions build [email protected]
30 silly decomposeActions install [email protected]
31 silly decomposeActions postinstall [email protected]
32 silly decomposeActions finalize [email protected]
33 silly decomposeActions refresh-package-json [email protected]
34 silly install executeActions
35 silly doSerial global-install 8
36 verbose correctMkdir /Users/vinicius/.npm/_locks correctMkdir not in flight; initializing
37 verbose lock using /Users/vinicius/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
38 silly doParallel extract 1
39 silly extract [email protected]
40 timing action:extract Completed in 322ms
41 silly doReverseSerial unbuild 8
42 silly doSerial remove 8
43 silly doSerial move 8
44 silly doSerial finalize 8
45 silly finalize /usr/local/lib/node_modules/ios-deploy
46 timing action:finalize Completed in 4ms
47 silly doParallel refresh-package-json 1
48 silly refresh-package-json /usr/local/lib/node_modules/ios-deploy
49 timing action:refresh-package-json Completed in 14ms
50 silly doParallel preinstall 1
51 silly preinstall [email protected]
52 info lifecycle [email protected]preinstall: [email protected]
53 verbose lifecycle [email protected]
preinstall: unsafe-perm in lifecycle true
54 verbose lifecycle [email protected]preinstall: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/ios-deploy/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/vinicius/Library/Android/sdk/tools:/Users/vinicius/Library/Android/sdk/platform-tools
55 verbose lifecycle [email protected]
preinstall: CWD: /usr/local/lib/node_modules/ios-deploy
56 silly lifecycle [email protected]preinstall: Args: [ '-c', './src/scripts/check_reqs.js && xcodebuild' ]
57 silly lifecycle [email protected]
preinstall: Returned: code: 65 signal: null
58 info lifecycle [email protected]~preinstall: Failed to exec preinstall script
59 timing action:preinstall Completed in 6331ms
60 verbose unlock done using /Users/vinicius/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
61 timing stage:rollbackFailedOptional Completed in 139ms
62 timing stage:runTopLevelLifecycles Completed in 7280ms
63 verbose stack Error: [email protected] preinstall: ./src/scripts/check_reqs.js && xcodebuild
63 verbose stack Exit status 65
63 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
63 verbose stack at EventEmitter.emit (events.js:182:13)
63 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
63 verbose stack at ChildProcess.emit (events.js:182:13)
63 verbose stack at maybeClose (internal/child_process.js:961:16)
63 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
64 verbose pkgid [email protected]
65 verbose cwd /Users/vinicius
66 verbose Darwin 17.6.0
67 verbose argv "/usr/local/Cellar/node/10.4.1/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy" "--unsafe-perm" "--allow-root"
68 verbose node v10.4.1
69 verbose npm v6.1.0
70 error code ELIFECYCLE
71 error errno 65
72 error [email protected] preinstall: ./src/scripts/check_reqs.js && xcodebuild
72 error Exit status 65
73 error Failed at the [email protected] preinstall script.
73 error This is probably not a problem with npm. There is likely additional logging output above.
74 verbose exit [ 65, true ]

@vinigabriel vinigabriel changed the title Ios-deploy install don't working Ios-deploy install don't work Jun 20, 2018
@vinigabriel vinigabriel changed the title Ios-deploy install don't work Ios-deploy install doesn't work Jun 20, 2018
@vinigabriel
Copy link
Author

I temporarily turn off the SIP and ran the commands again. I got build sucess.

@ceeyang
Copy link

ceeyang commented Jun 26, 2018

I had turn off the SIP, but it does't work for me .

@ceeyang
Copy link

ceeyang commented Jun 26, 2018

image

@tonylucas
Copy link

I had same problem, even turning off the SIP.
I removed XPCServices file, and the install worked;

@ceeyang
Copy link

ceeyang commented Jun 26, 2018

@tonylucas I have no XPCServices file, I don't know how to do, can you help me

@ceeyang
Copy link

ceeyang commented Jun 26, 2018

@tonylucas thanks very much, I got it.

@smallMotorFly
Copy link

@tonylucas thanks very much, I got it too.but does the file work for others?

@KimCongMax
Copy link

hey guy,how did you remove this file?

@tonylucas
Copy link

tonylucas commented Jul 10, 2018

@KimCongMax sudo rm /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices
But you need to turn off the SIP to be able to do it.

@KimCongMax
Copy link

@tonylucas i tried ,but failed with this tips
rm: /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices: Operation not permitted

@tonylucas
Copy link

But you need to turn off the SIP to be able to do it.

@KimCongMax
Copy link

@tonylucas Thanks ,come china, i owe you a dinner

@KimCongMax
Copy link

this problem bothered me a day @tonylucas

@jaydrogers
Copy link

jaydrogers commented Jul 11, 2018

UPDATE: This is a workaround, not a solution

I wouldn't call this a solution, but at least this will get you moving forward again. Follow #349 for a solution. Seems kind of sketchy that we have to disable system protections on macOS to delete a core system file.

How to apply the workaround:

For those looking for a straight forward solution workaround, I was able to resolve this on my machine following the instructions in this thread.

My environment:

OS: macOS High Sierra 10.13.5
Xcode Version: Version 9.4.1 (9F2000)

Disable "SIP"

  1. Click the  symbol in the Menu bar.
  2. Click Restart…
  3. Hold down Command-R to reboot into Recovery Mode.
  4. Click Utilities.
  5. Select Terminal.
  6. Enter csrutil disable.
  7. Enter reboot.

Attempt install with "SIP" disabled

  1. After reboot, move XPCServices file to temporary location for safety purposes sudo mv /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices ~
  2. Attempt install again with this command sudo npm install -g ios-deploy --unsafe-perm --allow-root
  3. Install should successfully complete.

Re-enable "SIP"

  1. Click the  symbol in the Menu bar.
  2. Click Restart…
  3. Hold down Command-R to reboot into Recovery Mode.
  4. Click Utilities.
  5. Select Terminal.
  6. Enter csrutil enable. (important that you set it to enable here...)
  7. Enter reboot.

==========
Update 2: Changed to a mv command instead of an rm command. Safety first! 👍

@XY113HE
Copy link

XY113HE commented Jul 11, 2018

@tonylucas thk u very much, it works, happyhappyhappy

@lyon007
Copy link

lyon007 commented Jul 13, 2018

good

@yytian1017
Copy link

@jaydrogers thk u very much, it works, happyhappyhappy

@bend-up
Copy link

bend-up commented Jul 13, 2018

@jaydrogers Thank you for workaround, I must however warn about installing ios-deploy with sudo and --unsafe-perm --allow-root.
With SIP disabled I've got my OS corrupted (permissions problem), not sure whether because of that command or because of operating with SIP disabled for some time. Anyway this is what worked for me and seems to be a safer version of your workaround:

  1. Reboot into Recovery mode and in terminal type:
    csrutil disable
  2. After reboot, move XPCServices file to safe location:
    sudo mv /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices ~
  3. Reboot into Recovery mode and in terminal type:
    csrutil enable
  4. After reboot install ios-deploy:
    npm install -g ios-deploy

My environment:

OS: macOS High Sierra 10.13.6 (17G65)
Xcode: Version 9.4.1 (9F2000)

@jaydrogers
Copy link

@bend-up Thanks for this. I updated my command for others so that it runs the mv command instead.

I cringed when I saw that sudo command too. When I tried it without the sudo permissions, it threw this huge message with a ton of warning flags (!!!!) saying that it will fail unless I added sudo and --unsafe-perm.

It would be really nice to see these commands removed for security and safety purposes, but it seems quite intentional that it needs sudo permissions.

@bend-up
Copy link

bend-up commented Jul 13, 2018

@jaydrogers yes, it warns you about that, however for me worked it without the sudo permissions, so I'd try that first and if that doesn't work then version with sudo.

@chazzmoney
Copy link

@bend-up I think you have a typo in 3.

csrutil enable

Thanks for your note - big help!

@bend-up
Copy link

bend-up commented Jul 18, 2018

@chazzmoney Thank you, updated.

@bennid
Copy link

bennid commented Jul 18, 2018

Is there any work being done to allow for this install to work without disabling SIP? I'm running on a machine in a datacenter I don't have access to, and have recently upgraded to High Sierra and xcode 9.4, and am now getting this error.

@jaydrogers
Copy link

jaydrogers commented Jul 18, 2018

@bennid: Track issue #349. There was a comment posted this morning that might work: #349 (comment)

@bennid
Copy link

bennid commented Jul 18, 2018

Unfortunately that still requires disabling SIP

@jasonfish568
Copy link

Thanks jaydrogers. This comment needs to be highlighted for everyone who comes to this page.

@nestamarl
Copy link

after I installed the "Xcode 10 beta 4" the problem disappeared

@jasonfish568
Copy link

Can anyone who tried nestamari's solution give us some feedback on it?

@shazron shazron added this to the 1.9.3 milestone Jul 24, 2018
@shazron shazron added the bug label Jul 24, 2018
@shazron
Copy link

shazron commented Jul 24, 2018

Duping to #349

@shazron
Copy link

shazron commented Jul 24, 2018

1.9.3 published with this fix: https://github.com/ios-control/ios-deploy/releases/tag/1.9.3

@stevecarlton
Copy link

Was able to confirm 1.9.3 resolved this issue. Thanks!

@GreenRidingHood
Copy link

I guess we dont read messages on the terminal, no offence I am the same :D
end of the error message, saying run with "--unsafe-perm=true" or else it will fail

!!!! WARNING:You are on OS X 10.11 El Capitan or greater, you may need to add the
!!!! WARNING: --unsafe-perm=true flag when running npm install
!!!! WARNING: or else it will fail.

so I run "sudo npm install --unsafe-perm=true -g ios-deploy" and worked

@matheusleite
Copy link

Nothing of this instructions worked for me at 1.9.3 version.

@matheusleite
Copy link

@GreenRidingHood Even with the "sudo npm install --unsafe-perm=true -g ios-deploy" command I receive this warning and don't work

@gersonmontenegro
Copy link

I only executed the command that bring us @jaydrogers :
sudo npm install -g ios-deploy --unsafe-perm --allow-root
And it works on my Mac OS Sierra 10.12.6

@sleeviin
Copy link

I guess we dont read messages on the terminal, no offence I am the same :D
end of the error message, saying run with "--unsafe-perm=true" or else it will fail

!!!! WARNING:You are on OS X 10.11 El Capitan or greater, you may need to add the
!!!! WARNING: --unsafe-perm=true flag when running npm install
!!!! WARNING: or else it will fail.

so I run "sudo npm install --unsafe-perm=true -g ios-deploy" and worked

This should be the right answer, it worked supernice, Thanks a Lot!

@andmar8
Copy link

andmar8 commented Nov 26, 2019

@GreenRidingHood Even with the "sudo npm install --unsafe-perm=true -g ios-deploy" command I receive this warning and don't work

Same on 1.9.3 or 1.9.4. Followed SIP disable advice, did the sudo install with unsafe perm and allow root... none of it works... just get the same OP error

I'm running catalina 10.15.1 with xcode 11.2.1 bv 11B500

... Nevermind:

"brew install ios-deploy"

Fixed!

@awaism551
Copy link

sudo npm uninstall -g ios-deploy
brew install ios-deploy

@hablema
Copy link

hablema commented Nov 30, 2019

@awaism551 : Thanks. That was the only thing that worked for me.

@happygirlcici
Copy link

@awaism551 thanks
sudo npm install -g ios-deploy --unsafe-perm --allow-root not working on Cellar Mac
and brew install ios-deploy, so happy

@iAbhinav
Copy link

UPDATE: This is a workaround, not a solution

I wouldn't call this a solution, but at least this will get you moving forward again. Follow #349 for a solution. Seems kind of sketchy that we have to disable system protections on macOS to delete a core system file.

How to apply the workaround:

For those looking for a straight forward solution workaround, I was able to resolve this on my machine following the instructions in this thread.

My environment:

OS: macOS High Sierra 10.13.5
Xcode Version: Version 9.4.1 (9F2000)

Disable "SIP"

  1. Click the  symbol in the Menu bar.
  2. Click Restart…
  3. Hold down Command-R to reboot into Recovery Mode.
  4. Click Utilities.
  5. Select Terminal.
  6. Enter csrutil disable.
  7. Enter reboot.

Attempt install with "SIP" disabled

  1. After reboot, move XPCServices file to temporary location for safety purposes sudo mv /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices ~
  2. Attempt install again with this command sudo npm install -g ios-deploy --unsafe-perm --allow-root
  3. Install should successfully complete.

Re-enable "SIP"

  1. Click the  symbol in the Menu bar.
  2. Click Restart…
  3. Hold down Command-R to reboot into Recovery Mode.
  4. Click Utilities.
  5. Select Terminal.
  6. Enter csrutil enable. (important that you set it to enable here...)
  7. Enter reboot.

==========
Update 2: Changed to a mv command instead of an rm command. Safety first! 👍

This worked perfectly for me. thanks a lot

@kangfenmao
Copy link

image

@zitup
Copy link

zitup commented Feb 27, 2023

You can try this, guys https://reactnative.dev/docs/running-on-simulator-ios

@smallMotorFly
Copy link

smallMotorFly commented Feb 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests