Xcode - Install additional required components usi

2020-02-08 02:49发布

I recently got a used Mac with Mountain Lion on it. I don't know of the admin password or anything, but I do know how to run a command line.

So here's what I am stuck on: asdf

When I click install, it asks me for my username and password (which I don't know of)

I want to install this via single-user mode (Cmd+S on Startup), which I accepted the license using it.

Do you guys know how I could achieve this?

标签: xcode macos
6条回答
做自己的国王
2楼-- · 2020-02-08 03:11

At least on XCode 9.2, you could use:

sudo xcodebuild -runFirstLaunch

to accept the agreement and install additional components.

查看更多
Anthone
3楼-- · 2020-02-08 03:16

Xcode 5.1.1 have a new argument:

> xcode -installComponents
查看更多
霸刀☆藐视天下
4楼-- · 2020-02-08 03:19

Resolved this issue using the below commands, it is on OS El Capitan and Xcode beta 7.2

sudo /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild  -license accept
sudo installer -pkg /Applications/Xcode-beta.app/Contents/Resources/Packages/MobileDevice.pkg -target /
sudo installer -pkg /Applications/Xcode-beta.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg -target /

Change the Xcode-beta.app path to your own, and you would need sudo(admin) access. Close your Xcode and open again.

查看更多
Ridiculous、
5楼-- · 2020-02-08 03:21

I know this is a looooooong time after the original post, but just in case anyone else finds this (as I did) while trying to install Xcode 8.2.1 on El Capitan (11.6)…

I had all the same problems listed here – long delay for lunch, then asking for additional tools to be installed, only to fail. The command line tools install also failed. I tried the various command line solutions listed, but none worked.

However, upon checking the log I saw that I was getting errors with certificates. On a hunch, I decided to put the system clock back to 20 December 2016 - voila, installs work like magic.

Put the clock back to today (30 October 2019) and still seems to work.

查看更多
\"骚年 ilove
6楼-- · 2020-02-08 03:21

Here's what I ended up doing. I went into recovery mode (CMD+R on startup), then to Terminal. I typed in

resetpassword

which then brought up a dialog of where I can select the user and set the password.

I then set the root password. Now when I can enter an admin password, I type in "root" and the password I set.

I got Xcode to load finally!

查看更多
走好不送
7楼-- · 2020-02-08 03:27

The commandline way to install required components is:

/Applications/Xcode.app/Contents/MacOS/Xcode -installComponents
查看更多
登录 后发表回答