Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Common iOS Build and Runtime Issues in Xcode Development

Tech May 10 4

Reversing Build Order in Xcode

To adjust the build sequence, reorder targets manually in the project’s Build Phases → Dependencies section or modify the Build Rule priority in the target’s Build Settings.

Clearing Xcode Derived Data Cache

  1. Open Xcode Preferences with Cmd + ,.
  2. Navigate to the Locations tab.
  3. Click the arrow next to Derived Data, then delete the contents of the opened folder.

Fixing "Command PhaseScriptExecution Failed" Error

This error commonly arises from outdated shell script syntax in custom build scripts (e.g., CocoaPods post-install hooks). Locate all instances of:

source="$(readlink ${source})"

and replace them with:

source="$(readlink -f ${source})"

Ensure -f is included to resolve nested symlinks correctly.

Resolving iOS Simulator Boot Failures

Option 1: Purge CoreSimulator Caches

Run the following in Temrinal:

open ~/Library/Developer/CoreSimulator/Caches

Then manually delete the entire Caches folder.

Option 2: Reset via Command Line

sudo killall Simulator
rm -rf ~/Library/Developer/CoreSimulator/Caches
# Launch Simulator again from Xcode or Dock

Bypassing App Transport Security (ATS) Restrictions

When loading HTTP resources, ATS blocks insecure connections by default. To allow exceptions:

  1. In Info.plist, add a new key: NSAppTransportSecurity (Dictionary type).
  2. Inside it, add a boolean key NSAllowsArbitraryLoads and set its value to YES.

⚠️ Only use this for development or internal services. Production apps should enforce HTTPS.

Resolving Swift Pod Module Import Errors

If a Swift pod (e.g., DKPhotoGallery) depends on a non-modular Objective-C library like SDWebImage, Xcode fails to generate module maps. Fix by updating your Podfile:

# Option A: Apply globally
use_modular_headers!

# Option B: Apply selectively
target 'YourApp' do
  use_frameworks!
  pod 'DKPhotoGallery'
  pod 'SDWebImage', :modular_headers => true
end

Then run pod deintegrate && pod install.

Installing Missing iOS Simulator Runtimes Manually

If Xcode fails to download simulator runtimes via Preferences → Components:

  1. Download the .dmg file directly from Apple Developer Downloads.
  2. Install it using:
    xcrun simctl runtime add /path/to/iOS_17.4_Simulator_Runtime.dmg
    
  3. Restart Xcode and verify under Xcode → Devices and Simulators → Simulators.

Restoring Missing libarclite After Upgrading to Xcode 15

Xcode 15 removes legacy ARC support files. If you see:

SDK does not contain 'libarclite' at ...

follow these steps:

  1. Confirm the missing path:
    ls /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/
    
  2. Create the directory if absent:
    sudo mkdir -p /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc
    
  3. Download the correct libarclite binary:
  4. Copy the appropriate file into the arc/ folder.
  5. Clean and rebuild the project.
Tags: iosxcode

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.