detachTarget works on macos