Repository navigation
Description
Hello,
Expected behavior
Install ios-deploy global via NPM
Actual behavior.
Ios-deploy not installed and get the error:
Ld build/Release/ios-deploy normal x86_64
cd /usr/local/lib/node_modules/ios-deploy
export MACOSX_DEPLOYMENT_TARGET=10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/usr/local/lib/node_modules/ios-deploy/build/Release -F/usr/local/lib/node_modules/ios-deploy/build/Release -filelist /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Objects-normal/x86_64/ios-deploy.LinkFileList -mmacosx-version-min=10.8 -Xlinker -object_path_lto -Xlinker /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Objects-normal/x86_64/ios-deploy_lto.o -fobjc-arc -fobjc-link-runtime -framework MobileDevice -F/System/Library/PrivateFrameworks -framework Foundation -framework CoreFoundation -Xlinker -dependency_info -Xlinker /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Objects-normal/x86_64/ios-deploy_dependency_info.dat -o /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy
ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Release/ios-deploy normal x86_64
(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.
Steps to reproduce the problem
I only run the command: npm install -g ios-deploy
System Specs
-
1. system_profiler SPSoftwareDataType
System Software Overview:
System Version: macOS 10.12.6 (16G29)
Kernel Version: Darwin 16.7.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 2:52 -
2. ios-deploy -V
-
3. xcodebuild -version
Xcode 9.0
Build version 9M202q -
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.0.0 (clang-900.0.34.1)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -
6. lldb --version
lldb-900.0.41
Swift-4.0
Activity
shazron commentedon Aug 11, 2017
Hello, when you filed a new issue, you deleted the template of requirements needed for filing a bug report. Please do that, there is not enough information. Without it, this issue will be closed.
RobertArissen commentedon Aug 11, 2017
Updated
shazron commentedon Aug 11, 2017
This is the root of the problem:
ld: framework not found MobileDeviceand you are using Xcode 9. It may be missing in Xcode 9. I will investigate later.[-]Ios-depoly install fails [/-][+]Ios-deploy install fails [/+]DomT4 commentedon Aug 15, 2017
It seems to have vanished from Xcode 9, but curiously is in the Command-Line Tools package Apple also distributes and after installing that it becomes available at the usual:
Build still fails though.
shazron commentedon Aug 15, 2017
It's probably looking for it at:
$XCODE/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks/MobileDevice.framework/where $XCODE is:
xcode-select -pshazron commentedon Aug 15, 2017
However, the linker does look for it at the location you found, see: https://github.com/phonegap/ios-deploy/blob/35c2c55fd15c3d20921941b44e3fd41b890f4253/ios-deploy.xcodeproj/project.pbxproj#L377-L380
DomT4 commentedon Aug 15, 2017
Yeah, this is enforced. If you flip it back to the CLT using
sudo xcode-select --resetthe build aborts & tells you your active developer path needs to be an Xcode instance.This smells like an Xcode bug to me, I can't imagine why this behaviour would be intentional. If you create any small valid
test.cfile & then do:It fails with the now rather familiar:
But if you explicitly use the
clanginside the CLT it works fine:shazron commentedon Aug 24, 2017
Similar report in #311
DomT4 commentedon Aug 24, 2017
Apple is aware of the issue. Last update was 3 days ago, an acknowledgement that they are looking into it with the information provided.
DomT4 commentedon Aug 25, 2017
Apparently if some
PrivateFrameworklinking remains broken through to GM we're stuck with it.Apple took 10+ days to decide they had no interest in fixing the bug. So
ios-deploymight continue to have issues with Xcode 9+ unless the Xcodeclangis accidentally fixed or a workaround is found here.I can link to other private frameworks just fine, so, I'm hoping they accidentally fix linking this specific one.
antonioribeiro commentedon Aug 29, 2017
Trying to fix
For which updating header paths was not helping, I decided to install ios-deploy and now I'm getting the very same error and cordova build also gives me a
Thank you, Apple.
DomT4 commentedon Sep 15, 2017
Intentionally or not, this is apparently fixed in the Xcode GM.
clang -Wall -framework MobileDevice -F/System/Library/PrivateFrameworks test.cnow delivers success & the expected linkage.shazron commentedon Sep 15, 2017
That's great. We'll wait and see if it's permanent, the workaround should still work for now
tommybananas commentedon Oct 24, 2017
@shazron what is the workaround?
shazron commentedon Oct 30, 2017
@tommybananas see #314
bjanuario commentedon Nov 27, 2017
If you are under Sierra you need to add the flag --unsafe-perm=true
sudo npm install -g ios-deploy --unsafe-perm=truetresdev commentedon Jan 22, 2018
@bjanuario this fixed the issue for me
pyqui commentedon Mar 25, 2018
@bjanuario Oh yeah!!! It works!
himalayaahuja commentedon Apr 17, 2018
@bjanuario It installs the package successfully yes, but again when I create a cordova ios build it throws the same error , saying ---------------
Unhandled promise rejection (rejection id: 1): ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'
pabloca88 commentedon May 11, 2018
@bjanuario solved my issue.. great Job!
mshyrokiy commentedon Jul 17, 2018
"sudo npm install -g ios-deploy --unsafe-perm=true" doesn't work for me
macOS 10.13.6
xcode Version 10.0 beta 3 (10L201y)
Is there any other way to get "ios-deploy" installed?
sgalvagno commentedon Dec 27, 2018
@mshyrokiy
brew install ios-deploy
ziwei3749 commentedon Jul 24, 2019
@sgalvagno this way make it work,thx