Check if an app is stuck in translocation
Sometimes apps that should run fine seem to find problems where there shouldn’t be any, becoming slow to launch, unable to update, erratic, and easily crashed. One reason that can account for these is that the app has become stuck in translocation. This article explains how you can check that, and what you can do to solve it and restore the app’s normal function.
App translocation, or Gatekeeper Path Randomisation (GPR), is a security mechanism intended to disrupt malicious code that’s dependent on its immediate location, perhaps to access other code in plugins. When a new quarantined app is run from the same folder it came in, it’s copied to a random path that appears as a volume, typically hidden at something like /private/var/folders/x4/[random chars]/T/AppTranslocation/[UUID]/d/, and run from there. However, it’s only present there while it’s running, and the moment you quit the app that location is unmounted, and vanishes.
In theory, translocation shouldn’t affect an app, but when it occurs repeatedly, it’s likely to prevent it from updating itself, and have other adverse effects. When an app has been translocated once, unless something is done to prevent further translocation, it’s likely to suffer the same fate every time it’s run, so becoming stuck in translocation.
Testing
To determine whether an app is being run from translocation, you need to discover the path of its executable when it’s running. That’s simple to do using Activity Monitor:
- Run the app from the Finder as normal.
- In Activity Monitor’s CPU view, locate the app in the list of processes, and select it there.
- Click on the ⓘ tool above to inspect the process.
- Look at the Executable Path given there.
If the path starts with anything like /private/var/folders/x4/[random chars]/T/AppTranslocation/[UUID]/d/, then the app is being run in translocation.
If you’d prefer to perform this in Terminal instead, run the app, then enter the commandps xw | grep AppName
to see its executable path. This was suggested by Quinn “The Eskimo!” of Apple’s Developer Technical Support.
Fixing
App translocation occurs when all the following apply:
- the app has a com.apple.quarantine extended attribute attached;
- the app must be opened by Launch Services (normally the Finder) rather than a command shell;
- the app hasn’t been individually moved in the Finder from the folder it was unarchived or downloaded to, wherever that was.
One common error that falls foul of those rules is when two or more apps are moved together from the Downloads folder into Applications, and another is to move an app inside the same folder it came in, into Applications.
Although you can strip the com.apple.quarantine extended attribute from the app, it’s simpler and better practice to:
- Move the app (one at a time) to another folder in the same volume, then run it from that location.
- Move the app back to the folder you want to keep it in, preferably in one of the standard Applications folders.
- Run it again from there and confirm that it’s no longer translocated.
Future updates should then work fine, and the app should be spared any further translocation.
Summary
- If an app isn’t working or updating properly, suspect it might be stuck in translocation.
- Run the app and inspect its Executable Path in Activity Monitor to determine whether it’s being translocated.
- If it is, move it elsewhere, run it, move it back, and check again.