Yoodley is reader-supported. When you buy through links on our site, we may earn an affiliate commission.
The Xcode 11 error notice “Command PhaseScriptExecution failed with a nonzero exit code” can be problematic for developers. This could indicate that an application or script is not functioning properly. To troubleshoot the problem, some potential remedies can be tried.
- In your Terminal app, navigate to the Xcode project folder.
- Type and run the following command: pod disintegration
- Run the following command: install pod
- Relaunch Xcode and navigate to Product > Clean Build Folder.
- Restart your app.
- Navigate to Keychain Access.
- From the login menu, select Lock and unlock again.
- Open Xcode > Clean Xcode Project > Restart your build.
- If neither of these alternatives work, you can contact Apple for assistance.
What is XCode?
Xcode is an integrated development environment (IDE) and code editor developed by Apple to assist developers in the development of Apple products, including mobile applications for iOS and desktop applications for macOS.
Xcode is a complete development environment that includes a collection of integrated tools and apps that are designed to aid with all development processes, including testing, building, deploying, compiling, and debugging. It is available for both Mac and Windows platforms.
How to Download Xcode and Install it on Your Mac?
The following is a step-by-step guide on installing Xcode:
- Obtain Xcode.
- Install the command-line utility on your computer.
- Open the new version of the programme.
- Delete any files that you don’t need.
Please keep in mind that we have included a number of Terminal commands in the stages below. These instructions should be typed into the current working directory of your computer. This eliminates the requirement for you to browse to a specific folder on your computer.
In order to avoid entering the instructions in the following steps, you can first type <cd> before typing the commands in the following steps. This will take you back to the home folder where you started.
Step #1: Download Xcode
- Navigate to the “more” area of Apple’s developer website.
- Log in using your iTunes account id.
- Enter the desired version and download the Xcode x x x.zip file.
- Once the file has been downloaded, double-click the.xip extension to unpack it. Your computer will extract it to the same location where you downloaded it. This extraction procedure is fully automated. After you’ve clicked on the.xip file, there’s nothing else you need to do. This will only take a few minutes.
- Add the application to the Applications folder by dragging it there.
Step #2: Install the command line tool (CLT)
Go to the app developer’s website and get the command line tool to update the CLT:
If you have never installed Xcode before, you may be able to update using your Terminal instead of accessing the developer website by entering <xcode-select —install>.
After the.dmg file has finished downloading, double-click it to open it.
To install the CLT, double-click the box and follow the on-screen instructions. It will only take a few moments to finish.
At the end of the installation, it may ask if you want to take this to the trash bin. When it says this, it’s referring to moving the.dmg file to the trash can, because you should no longer require this file.
Step #3: Open Xcode
Navigate to the Applications folder and launch the new version of Xcode. Make sure you open the correct programme if you renamed Xcode.
You may be prompted to install extra components by Xcode. Install should be clicked. This will only take a few moments.
Check that your default Xcode version is the one you just downloaded while it’s installing:
- Type <brew config> in the Terminal window.
- There should be “CLT” and “Xcode” versions, in addition to everything else.
Xcode will launch after the components have been installed. You should be able to smoothly pick up past work and continue where you left off*.
*Please keep in mind that if you use any proxy tools, such as Charles, you will have to re-install those certificates in your simulator.
Check which device you are attempting to launch if you encounter any difficulties while attempting to develop or run a project. The new version may not recognise the device you previously used. If this is the case, click on the device and select “Add more simulators” from the drop down option to add the device.
Step #4. Delete the files
If you don’t require older versions of Xcode on your computer, you can uninstall them to free up disc space.
You can also remove the CLT.dmg file and the.xip file from the version you just downloaded.
How to Start Using Xcode to Build Your React Native iOS Apps?
If you don’t already have Node and Watchman installed, you can install them with Homebrew by running the following terminal commands:
<brew install watchman brew install node>
While you are most likely already familiar with these as a React Native developer, it is a good idea to install Node 10 or later.
You will, of course, need to install Xcode. You may get it from the app store by clicking here. Then you’ll need CocoaPods, which maintains library dependencies for your Xcode applications. As a result, install using:
<cocoapods sudo gem install>
To begin a new project, navigate to the location where you want to save it, then type in your terminal,
<npx react-native init <the name of your new project>>
When you open your project in your code editor, you’ll notice that it contains some boilerplate code. Simply type to execute your project and observe it on a mobile device simulator:
<start npx react-native
run-ios npx react-native>