iphone sdk missing from xcrun how to build for iphone from command line?
Asked Answered
H

1

5

I'm trying to figure how to build metal shaders for iphone os using xcrun. I have (the almost latest) Xcode 11.3.1 installed on macos 1.4 Mojave.

xcrun --sdk iphoneos --show-sdk-path reports that the sdk cannot be found.

I checked xcrun --sdk macosx --show-sdk-path, which reports /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

The iphone and TVOS sdks don't seem to be there at all. However, I'm able to use the Xcode IDE to build to an iphone. I checked the build logs and found that one step sets the SDKROOT to: SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk which is inside the Xcode bundle.

I want to be able to build from the command line, but clearly the correct path hasn't been registered. Do I need to reinstall the command line tools, or is there some setting I need to add an SDK to xcrun?

How do I proceed?

Heiress answered 30/3, 2020 at 22:49 Comment(0)
H
6

I very quickly realized that I must have been using the bare-minimum command line tools from when I first installed the machine.

In Xcode, go to Preferences>Locations and select a specific set of command line tools from the drop-down. This updates xcrun to point to the full collection of SDKs that Xcode provides.

Heiress answered 30/3, 2020 at 22:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.