1

Where is xcrun cache stored? Also does anyone know how to use xcrun command to clean cache?

I assume this is the option:

-k, --kill-cache            invalidate all existing cache entries
vladof81
  • 26,121
  • 9
  • 38
  • 41

2 Answers2

2

Look at the console log, you can find the path where the temporary files are:

Done checking the original app
+ /usr/bin/codesign -d --entitlements /var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/entitlements_rawnyg500kb /var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/Payload/Test.app
Program /usr/bin/codesign returned 0 : [Executable=/private/var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/Payload/Test.app/Test
]
+ /usr/libexec/PlistBuddy -c Set :get-task-allow NO /var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/entitlements_plistvl0d7HId
Program /usr/libexec/PlistBuddy returned 0 : []
+ /usr/bin/plutil -lint /var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/entitlements_plistvl0d7HId
Program /usr/bin/plutil returned 0 : [/var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/entitlements_plistvl0d7HId: OK
]

The cache directory of this run is: /private/var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/

It's good idea to write script clean up the files after.

rm -rf /private/var/folders/29/lb71hkjn46b2g7zfvcxpb4br0000gp/T/SXfVLy4n3G/
0

The cache usually exists at $TMPDIR/xcrun_db. However, the environment variable xcrun_db or unknown other factors can potentially change it.

I disassembled libxcrun.dylib and found that you can ask xcrun where the file is: xcrun --show-cache-path.

Aaron Gyes
  • 11
  • 4