Mac App Store / TestFlight installs app to random folders

On my dev machine, I built my app to the 'dist' folder, the app was signed in either a 'Development' provision profile, or a 'Distribution' provision profile.

I then published the app to Mac App Store and it is alive. When I tried to install the app, I noticed that Mac App Store may install my app to my 'dist' folder (i.e. the build folder) instead of 'Applications' folder.

Is there a way to make sure that the app will always be installed to the 'Applications' folder?

Testing on a non-dev machine seems to be working fine.

Answered by DTS Engineer in 803086022

It seems like the App Store app on your Mac has recognised that the app is installed elsewhere on the system and is doing an update of that rather than installing a second copy in the Applications folder. That’s a bit weird, but it seems like a reasonable choice.

Presumably, if you delete the copy of your app from that dist directory then App Store will install it in the normal place.

Testing on a non-dev machine seems to be working fine.

I think that’s what you need to focus on. It’s reasonable to assume that your customers won’t have development builds of your app lying around on their hard disk (-:

Another interesting case to explore is to install the app on a customer system, then move it to a different directory, and update it. I suspect that’ll also update the moved copy.

One final wrinkle: macOS 15 (currently a release candidates) lets users specify an alternative volume to use for large App Store apps.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It seems like the App Store app on your Mac has recognised that the app is installed elsewhere on the system and is doing an update of that rather than installing a second copy in the Applications folder. That’s a bit weird, but it seems like a reasonable choice.

Presumably, if you delete the copy of your app from that dist directory then App Store will install it in the normal place.

Testing on a non-dev machine seems to be working fine.

I think that’s what you need to focus on. It’s reasonable to assume that your customers won’t have development builds of your app lying around on their hard disk (-:

Another interesting case to explore is to install the app on a customer system, then move it to a different directory, and update it. I suspect that’ll also update the moved copy.

One final wrinkle: macOS 15 (currently a release candidates) lets users specify an alternative volume to use for large App Store apps.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It’s best if you reply as a reply, rather the the comments. It’s easy for me to miss comments. See Quinn’s Top Ten DevForums Tips for this and other titbits.

I am wondering if you know a way to clean up the app cache or registry (not sure what is the name though), so that macOS doesn't know that it has the app installed

Not really. The subsystem in question here is Launch Services, which maintains a database of all the apps installed on the system. There is some access to that (via the lsregister tool; search DevForums for that to find my other post on it) but my experience is that, when you pick you a fight with Launch Services, you usually lose )-:

The best way to test this stuff is in a VM, where you get much better control over what is installed and where. The sticking point there is that Apple silicon VMs have only limited support for Apple ID authentication. See AppleID Login failing in virtualized OS. I haven’t yet had a chance to test whether that includes Mac App Store.

OTOH, running such tests in a VM on Intel is great!

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I am using the following script to unregister my apps from the Launch Services. Thank you for your help, Quinn!

#!/bin/bash

# List of app names to unregister from Launch Services
names="Electron.app|MyApp.app"

# Function to unregister an app
unregister_app() {
    local path="$1"
    echo "Unregistering: $path"
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -u "$path"
}

# Run lsregister -dump and grep for specific apps, then process each line
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump | grep -E "$names" | while IFS= read -r line; do
    # Extract the app path
    path=$(echo "$line" | cut -c 6- | rev | cut -c 10- | rev | xargs)
    
    # Check if path is not empty
    if [ ! -z "$path" ]; then
        unregister_app "$path"
    fi
done

echo "Unregistration process completed."```

Mac App Store / TestFlight installs app to random folders
 
 
Q