3

Suppose I ask the user "do you want to run in 32bit mode or 64bit mode" and they pick 32bit. How do I register this fact with the operating system? I've looked at the arch command, but I don't want to have to write a script that wraps the binary. I suspect there is a plist-y way to do this, but I can't find documentation (other than arch).

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222

3 Answers3

5

Try using this Info.plist key, LSArchitecturePriority:

<key>LSArchitecturePriority</key>
<array>
    <string>i386</string>
    <string>x86_64</string>
    <string>ppc</string>
    <string>ppc64</string>
</array>

Just don't do this by dynamically altering your program's bundle. The user running your program might not have permission to write to it. If you need to do this on a per-user basis, a wrapper script would be a preferred alternative.

John Calsbeek
  • 35,947
  • 7
  • 94
  • 101
1

You're probably looking for something like LSArchitecturePriority. Runtime Configuration Guidelines - Property List Key Reference is the documentation for all the key / values for an .app bundles Info.plist file.

johne
  • 6,760
  • 2
  • 24
  • 25
0

The other way to do it is by setting the ARCHPREFERENCE environment variable, as described on the arch man page.

cdespinosa
  • 20,661
  • 6
  • 33
  • 39