3

Is there any way to have multiple installs of the same application (in the same user account)?

Basically, I have several google reader accounts, and I want to be able to have multiple instances of Reeder. As it is, changing accounts at the moment involves restarting the app, and manually typing the different account info in. At that point, you have access to only one of the accounts, and switching involves the whole rigamarole again.

Is there any way I can have something like a sandbox for each instance, with it's own keychain?


I have Xcode installed, and I would imagine there is some mechanism in Xcode for letting programs have separate keychain/info, for when you are testing an app you have compiled. Is there something like this and/or how do you use it?

7 Answers 7

1
+250

The only way to achieve this with applications that do not have native multi-account support would be to patch the CFBundleIdentifier which is also used by the application to find passwords on keychains. You can change that by editing the Info.plist file in the application bundle. This will break the digital signature of the application, so always work on a copy.

With Reeder being an application from the Mac AppStore this will break the digital signature of the application rendering it non-launchable. So you will need to remove all signs of Contents/_CodeSignature/CodeResources as well. Then this might work unless the application does additional bundle checking that will prevent this. (Which is something I don't know in the case of Reeder.) When that actually works, you will need to launch the application with a secondary-click (right click, two-finger click or ctrl-click) then selecting “Open” from the contextual menu and confirming the subsequent warning from Gatekeeper. (I definitely can not recommend to turn off Gatekeeper completely.)

Of course you will need to do all these steps for each and every copy after each update of Reeder again. (With the risk that Reeder may add additional checks at any time rendering this process not working anymore.)

Other solutions may be to use different RSS clients for your multiple accounts and requesting multi-account support from the developers.

1
  • Well, I wound up with multiple different RSS readers. I had no luck tweaking the contents of the app's .plist or anything.
    – Fake Name
    Commented Oct 3, 2012 at 9:21
5

You can do this with Reeder.

  • You will need as many user accounts as you have Google accounts.
  • Supposing you have 2 Google accounts, you can obviously run your main Google account as the default user. Just click on Reeder from Launcher or Dock and you are good to go.
  • Go to System Preferences, Users & Groups, and create a new user. Call it TestUser. Make sure you set a password. A standard user account would do.
  • Open Terminal.
  • execute this: echo "password" | sudo -S -u TestUser /Applications/Reeder.app/Contents/MacOS/Reeder &

voila! You can now see a 2nd Reeder window!

4
  • 1
    ok, i tested this out and works fine. my copy of reeder came from the app store.
    – user30988
    Commented Sep 29, 2012 at 21:50
  • 1
    Does it successfully access the keychain? I can get this to work with other apps (Safari, for instance) and they'll run with the settings, history, etc. from the other account, but they give an error when trying to access stored passwords.
    – Daniel
    Commented Oct 2, 2012 at 13:29
  • This produces "Keychain not found" errors when you actually enter your google login info.
    – Fake Name
    Commented Oct 3, 2012 at 9:08
  • Logging into the new account and logging in using reeder there does not help. Neither does switching users with su or sudo -u
    – Fake Name
    Commented Oct 3, 2012 at 9:16
2

Create a new desktop user for each different Google Reader account. Then you may use fast switching between accounts to change to the desired user (there's a menu bar available for that).

You may also be able to use a shell command to launch a process under the same window manager from another user. Say su other_user -c 'open /Applications/Reeder.app'. I've done this to launch GUI applications as root. I toyed around with opening Chrome using that approach, but it seems like the keychain isn't initialized correctly in that case -- it might be trying to read the keychain from the host user. You may be able to resolve that by first logging in as the user, creating the keychain, and then running the script.

Addendum: I'm not sure if an App Store program will launch as another user, having different authentication (I haven't used App Store yet). If that's the case, I would create a script to temporarily modify the keychain, launch Reeder, and then recreate the original. That's a pretty grotesque approach, though.

1

Depends on the app, I imagine this is perfectly possible for some, and not for others. It depends on whether the app is self contained in it's own bundle, or if it requires the use of ancillary file in your ~/library folder, such as plists etc. Use of such plist files etc is often where your settings and preferences are stored including account settings, and having multiple instances of the application will still result in them all looking in the same location for the plist file.

You could wrap your application binary in some scripting to move the correct plist in place before starting each instance, but again app dependant, there is no guarantee that an app already running will continue to run if it's plist changes, or it it will just take on the new settings at some point.

2
  • In this case, the things of import are contained in the keychain. I need to somehow redirect any keychain access, or change the name one of the app instances uses to store things in the keychain.
    – Fake Name
    Commented Aug 13, 2012 at 8:36
  • I'm betting that xCode has a tool to do this. After all, if you're developing an application, you don't want it making a giant mess of your system/ ~/library dir/keychain/whatever if you have a programming error.
    – Fake Name
    Commented Aug 13, 2012 at 8:39
1

If the app came from anywhere other than the App Store, I'd suggest you had a reasonable chance of poking around inside the app bundle and maybe changing what it considered its name to be by editing a .plist and hoping that the name influenced the keychain usage.

However, as Reeder is an App Store app, I suspect you're stuck. If you modify the app, its signature will become invalid and the OS won't let you run it. Unless there's some sort of self-signing hack you can do...

3
  • This is on a desktop. I have gatekeeper totally disabled too. I can't think of any other things that would prevent an app from running.
    – Fake Name
    Commented Aug 13, 2012 at 8:51
  • In that case, make a copy of the bundle, edit the .plist in the copy and see if you can influence its keychain usage. I'd try myself, if I weren't stuck in front of a none-Apple machine all day.
    – Chris
    Commented Aug 13, 2012 at 9:00
  • Hmmm, interesting. Will do
    – Fake Name
    Commented Aug 13, 2012 at 10:03
1

No - the keychain is a deeply embedded system interface where the mapping is strongly tied to the user home folder (the application doesn't get to choose which user's keychain to access as the system tells it which literal folder maps to ~).

However, the only special case where this will work is for applications that are programmed in with code to read a configuration file (plist file, .dotfile, or other mechanism) and you could use automation to set those run time variables, settings or directly manipulate the .plist files before launching the app in question.

  • Platypus would be my choice for a shell script to change things and then launch the app and bundling things.
  • Keychain Scripting might also scratch your itch if you could retrieve the name of the keychain item you wanted to pass into the app to get different behavior each launch.

The system doesn't have a view of sandbox for this separation of data other than if you were to literally start a second user session (which Lion and later allow) but the app would need to opuput the data to a pipe or a file rather than exist on screen as a running app from a different user.

Short of writing this tool yourself (you do have Xcode after all), there isn't something that Apple provides to automate keychain sandboxing as I understand you describing it.

0

I am betting here, but some applications cannot be opened twice and I cannot buy Reeder for tests purposes. However, I suppose that you cannot open it twice. What happens when you duplicate the .app and try opening both different .app's? If something like that works, you could try having a duplicate .app and maybe find the contents that you want shared or which can be shared between both of these as symbolic links from the copy referencing the original or main app.

Does something like this help somehow?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .