Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Xcode is not correctly detected when opening iOS workbooks #249

Closed
atsushieno opened this issue May 3, 2018 · 7 comments
Closed

Xcode is not correctly detected when opening iOS workbooks #249

atsushieno opened this issue May 3, 2018 · 7 comments

Comments

@atsushieno
Copy link

I have Xcode 9.3 installed but Workbooks.app does not recognize it.

Steps to Reproduce

  1. launch workbooks.app
  2. open iOS workbook sample e.g. "learning iOS" sample linked from https://developer.xamarin.com/workbooks/

Expected Behavior

It just works.

Actual Behavior

screen shot 2018-05-03 at 14 19 23

Environment

Xamarin Workbooks

Detail Value
Version 1.4.0
Git Branch master
Git Hash b3f92f9
VSTS Definition Workbooks & Inspector (Mac)

System Info

Component Value
macOS Version 10.13.4 (Build 17E202) (64-bit)
CPU Cores 4 / 4
Physical Memory 16 GB

System-Installed Software

Component Version
Mono 5.10.1.47
Xamarin Mac 4.4.1.173
Xamarin iOS 11.10.1.174
Xamarin Android 8.3.0-18
Visual Studio 7.5.0.1222 (705001222)

Log File

Xamarin Workbooks 2018-05-03.log

@sandyarmstrong
Copy link
Member

Are you able to deploy Xamarin.iOS apps to your Xcode 9.3 simulator from VSmac?

We need to make sure this message gets surfaced better (it's in the log): Unable to locate a valid Xcode installation. Check the Apple SDK settings in Xamarin Studio preferences or ensure that xcode-select -p returns a valid Xcode installation path.

If you follow these instructions, are you able to get Workbooks (and VSmac, and Xamarin.iOS in general) to recognize it?

@atsushieno
Copy link
Author

Yes, it just worked. (Also reran workbooks to verify that the problem still occurs.)

screen shot 2018-05-03 at 23 10 25

screen shot 2018-05-03 at 23 13 40

$ xcode-select -p
/Library/Developer/CommandLineTools

@sandyarmstrong
Copy link
Member

sandyarmstrong commented May 3, 2018

Can you share your ~/Library/Preferences/Xamarin/Settings.plist?

My guess is that it does not have any xcode path in it, and that VSmac is actually checking the default path first, which we do not do.

So then, we look using xcode-select, but your xcode-select path seems very wrong, unless something has changed in Xcode 9.3 that I don't know about. You probably need to run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer, at which point I expect Workbooks will find your Xcode just fine.

We should start checking /Applications/Xcode.app by default to emulate VSmac behavior.

@atsushieno
Copy link
Author

It was, well, empty:

$ cat ~/Library/Preferences/Xamarin/Settings.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

Setting Xcode path by the xcode-select use above "fixed" the issue.

My Macbook is very fresh (started using last week) so I assume this is the default settings for not a few people.

@sandyarmstrong
Copy link
Member

@atsushieno did you manually set your xcode-select path to /Library/Developer/CommandLineTools? If not, do you recall the steps you went through to set up Xcode, command line tools, etc on your machine? I'm very curious how that path got there.

But yes, we will fix Workbooks to also check the default installation path, like VSmac does, for those who don't have xcode-select configured properly.

@atsushieno
Copy link
Author

I didn't run xcode-select on this machine before. My Xcode was installed from App Store - I can't think of anything that would overwrite the paths.

@sandyarmstrong
Copy link
Member

Awesome, thanks for all the great info.

We'll get this fixed.

@sandyarmstrong sandyarmstrong self-assigned this May 3, 2018
sandyarmstrong added a commit to sandyarmstrong/workbooks that referenced this issue May 10, 2018
sandyarmstrong added a commit to sandyarmstrong/workbooks that referenced this issue May 10, 2018
sandyarmstrong added a commit to sandyarmstrong/workbooks that referenced this issue May 10, 2018
sandyarmstrong added a commit to sandyarmstrong/workbooks that referenced this issue May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants