Apple's Xcode App

Sometime the macOS Xcode App doesn't work correctly from time to time. I install the Apple's Xcode App updates following the Apple's notifications. Do any people also experience the same while using the Apple's Xcode App on iMac? Do any people know how to fix the problems or what App to use to do the C++ programming and the Python programming? Thanks a lot!

iMac 27″ 5K, macOS 13.1

Posted on Dec 29, 2022 1:58 PM

Reply

Similar questions

4 replies

Dec 29, 2022 5:00 PM in response to Merslamarer

message-1:


Apple's Xcode app is essential for app development, test, etc, etc, etc.



Start the "Terminal" app, inside the Applications > Utilities.



To view installed Xcode version number, run this/below command inside the Terminal window :

$ xcodebuild -version

... If output is not-showing version number then Xcode is not-installed.



Many programming related apps still need separate installation of apple's CLT (Command Line Tool),

you may download CLT's DMG installer file from apple Developers website (a free type dev account creation is required there), then you can run the CLT installer pkg/app in DMG file),

or, run the below command in "Terminal" window:

$ xcode-select --install



To view installed CLT version number, run this command:

$ pkgutil –pkg-info=com.apple.pkg.CLTools_Executables

... If above command's output is not-showing verison number or showing msg that “…No receipt…” etc, then CLT is not installed, or its already bundled inside+with Xcode.

To view all pre-installed pkgs you may run :

$ pkgutil –pkgs



Run below command combinations in Terminal window, it will show installed CLT's compiler/builder component's version numbers:

$ gcc -v && llvm-gcc -v && clang -v



You may also run xcrun clang command, & see what it outputs:

UserMacBook:~ username$  xcrun clang
clang: error: no input files

... in above, if output is NOT this message clang: error: no input files, then either CLT installation has error or executable files are not placed in PATH environment variable correctly yet.



Run below command in Terminal window:

$ defaults write com.apple.Finder AppleShowAllFiles true

... Above command only makes the files viewable inside file-browser ("Finder", "Terminal", etc) type of software, it does not actually change any file-attributes.

After above command, user need to: either restart the mac computer, or run below command in Terminal window:

$ sudo /usr/bin/killall Finder /System/Library/CoreServices/Finder.app



In macOS "Finder" or inside any other file browsing window, a user can also press below THREE buttons/keys (in keyboard) altogether ONCE to show/view all HIDDEN files/folders:

[Command] + [Shift] + [.>]

Those who use windows-keyboard:

[WindowsFlag⊞] + [Shift⇧] + [.>]

... These buttons, actually does not remove any real "Hidden" file/folder attribute to make a file/folder visible, these buttons only tells the file-browsing app to make the real "Hidden" file/folder visible, inside the browsing window, temporarily.

When user press-es above three buttons again, file-browsing-window will make the real HIDDEN files/folders, invisible again.



By default in macOS, the "Finder" will keep most of the file extension hidden. But we need to see all file's extension to see FULL filename, so that we can be sure & not make mistake, when we will specify/use file/folder.

To view all file's extension, do below steps:

in macOS > start “Finder” app > goto main menu > Finder > Preferences > Advanced > select the "Show All Filename Extensions" option.



macOS by default uses a very old version of bash shell. Many prefers bash shell over the newer zsh shell, but they want newer bash shell, but apple wont add/include newer version bash shell.

So users usually load latest stable bash shell via 3rd-party package-manager software, such as : MacPorts , HomeBrew , pkgsrc , etc.

I prefer bash shell.

I prefer MacPorts pkkg-mngr, because HomeBrew pkg-mngr shares user's usage data with Google from beginning by-default, despite knowing Google records for-ever. (ByTheWay, MacPorts was developed 7 years before Brew/HomeBrew).


Change the default shell in Terminal on Mac - Apple Support

Use zsh as the default shell on your Mac - Apple Support

Change zsh to other/different shell - Apple Support



When/Once you decide & setup shell (in macOS Terminal) what you want to use,

then follow above links to setup the shell.

Different shell has different config file to control shell activities, pls see this again.



Then you have to setup/fix the "PATH" : 1 , 2 , 3 .

PATH is a "search-sequence" to allow+find a specific file among many many folders, folder-trees.


Command Line Primer (please follow sub-links inside that webpage to learn/know/refresh more).



I usually keep a shell-script file called "DevMode.sh" in my home directory inside macOS.

in Terminal, inside a specific tab, i run that shell-script, to switch into development mode.



By-default, your mac computer should not be running in full development mode, then unwanted activities will have more opportunities to run/do more harmful/abusive activities, because more "power"/tools are available.


inside Terminal, inside a tab, a user can start a development mode, to do development/programing related works, then close that if you want-to or need-to, ... that is more safer.

Anyway, you have to find a balance that suits you, w/o sacrificing key/major security/safety.



... pls see next message ...


Dec 29, 2022 5:47 PM in response to Merslamarer

message-3:


... pls see earlier msgs ...



A command to verify, if CLT is installed or not:

$ pkgutil --packages | grep CLTools



Here is a website showing Python programming inside Xcode, here are others : 2.

Use Python 3.8 in Xcode 11, more info.



Here are few sites showing C++ programming inside Xcode : 1 , 2 , 3 .

  • in Xcode : Select File -> New Project...
  • Select Mac OS X -> Application -> Command Line Tool (I'm assuming that you are making a simple C++ app that uses stdin/stdout, not a Cocoa-based GUI)
    • For "Type", choose "C++ stdc++"
    • Click "Choose..." and give the project a name and location
  • A new project window will appear. Open the "Source" group (folder) on the right hand side. There will be a main.cpp file. You can use that file if desired, or select it and hit the Delete key to get rid of it.
  • Select Project -> Add to Project...
    • Select the files (headers and .cpp files) you want to add to the project.
  • Select Build -> Build and Run to run your project.




BY THE WAY, PLEASE GOTO APPLE DEVELOPER FORUMS , ASK ( XCode or related , Development related, etc) QUESTION(S) THERE , THERE YOU CAN GET BETTER HELP/INFO.

Dec 29, 2022 4:49 PM in response to Merslamarer

message-2:


... pls see earlier message-1 ...


...


Python can be obtained from here, directly,

but its better to have the Python via your choice of pkg-mngr.


So when you/user will properly setup PATH & shell, then Xcode, CLT, etc will begin to work properly for various other programs.



By-default they are pre-set to not-work instantly for all apps,

because different developer needs different development environment,

and, the fact is "Development/build related all power utility tools should not be always available/accessible to all other apps, etc, because such tools create more opportunity to abuse, So to keep it minimal, keep them in islands, a dev should setup necessary bridges, according to their need & safety's balance & compromise".



Many users (or new devs or newbs) do not like this,

but safety & security has more importance (aka: more PRIORITY) over convenience, when you dive deeper into development arena/works, etc etc,

it is not your daily entertainment things/activities that, convenience has more priority or preferable.


Dec 29, 2022 5:11 PM in response to Merslamarer

Merslamarer wrote:

Sometime the macOS Xcode App doesn't work correctly from time to time.

In what way? All software has bugs. Considering how complex Xcode is, it is remarkably bug-free.

Do any people know how to fix the problems

What problems, specifically?

App to use to do the C++ programming and the Python programming?

Xcode is designed for Objective-C and especially Swift programming. It can certainly do C++ as well, but there isn't much call for pure C++ programming on the Apple platform.


Python is a completely different story. The normal workflows of the Python community are very difficult to accomplish on a Mac. Well, it's not that difficult, but it involves more than "apt-get" and that's beyond the abilities of most.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple's Xcode App

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.