Xcode Tips for iOS Security Researcher
Reduce Disk Space
- Note: on your own risk
- If don’t do the watchOS related work, delete:
/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime
- If don’t do the tvOS related work, delete:
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS.simruntime
- If only draw UI by programming, not using
storyboard
etc, delete(better keep it):/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime
- do sim cleaning:
xcrun simctl delete unavailable
- delete unused device support files:
~/Library/Developer/Xcode/iOS DeviceSupport ~/Library/Developer/Xcode/watchOS DeviceSupport
- delete
DerivedData
:~/Library/Developer/Xcode/DerivedData
- delete
CoreSimulator
cache:~/Library/Developer/CoreSimulator/Caches/dyld
Multiple Versions
If don’t care about the UI of Xcode, you don’t need to install two or more Xcode:
- copy the
XcodeDefault.xctoolchain
from the newer version to/Applications/Xcode.app/Contents/Developer/Toolchains/
then rename it, and use it later.
- copy the
SDK
to:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /Applications/Xcode.app/Contents/Developer/Platforms/DriverKit.platform/Developer/SDKs
and choose the sdk in Xcode’s project config pane.
- copy the
DeviceSupport
to:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport
PS
- Xcode 16:
/System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime https://mastodon.social/@_inside/112904004439494121
- TODO