Skip to content

macOS requires -r for binaries to work across reboots #175

@zwimer

Description

@zwimer

Running shc -f a.sh creates a.sh.x, which works fine until macOS is rebooted. After that it'll print something like:

The error message: "
uE?A@1??G??oAg!X??^I'
?_??8?has expired!
Please contact your provider jahidulhamid@yahoo.com

Retrying this with shc -f a.sh -e 01/01/3000 will lead to a different failure, with different garbage text and the word expired in the mix.
Regardless of if -e is used or not, the binary will fail.

To alleviate this, I've found binaries must be created using the -r flag. That is shc -rf a.sh creates a binary that will work after macOS restarts.

Env: macOS 15.5 using 4.0.3 installed via brew.

Related: #12

Why I tried -r:
#89 (comment)
#89 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions