Launch At Startup Sample

AlNyveldtAlNyveldt USInsider, University ✭✭

I've been trying to get a sample app launching at startup and it is just not happening.

I found this handy thread https://forums.xamarin.com/discussion/45255/how-to-set-my-sandboxed-app-launch-automatically but I still can't quite get a helper app bundled properly with Xamarin.Mac.

Does anyone have a sample available that I could look at to get this working?

Posts

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    @JohnConners was the original poster. He might know.

    Where did you put the helper app, inside the main bundle.

    A sample showing what you tried may be useful to help debug.

  • JohnConnersJohnConners GBMember ✭✭
    edited November 2015

    So assuming you've followed the steps to build the helper app from this page you need to put that helper (e.g. MyLoginItemHelper.app) inside the following folder in your app bundle:

    Contents/Library/LoginItems/MyLoginItemHelper.app

    I have build steps in my project that builds the XCode helper project and copies it to the above folder so that when the app bundle is signed it's already included. But to try it out all you need to do is manually copy it in there, do another build in Xamarin.Mac and it'll automatically be signed correctly since it'll already be there.

    To test it you need to run your app from the Applications folder and make sure you've deleted every copy of your app anywhere on your system and emptied the recycle bin. I've found that if you have a debug build in your projects folder, on your desktop or somewhere else then the launcher will either not launch your app at all or will launch the wrong version. So long as the one in Applications is the only version on your system it'll do the right thing.

    Launching Console.app is very handy as any errors when you enable launch at startup will show up there, likewise when you log in and it attempts to start your app it'll tell you what it's doing there. Should there be a problem with the signing in your app, again it won't work and may or may not show an error in Console. I use "RB App Checker Lite" to confirm that the app and the embedded helper are correctly signed.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    @JohnConners Thanks for swigging by and answering.

  • AlNyveldtAlNyveldt USInsider, University ✭✭

    @JohnConners and @ChrisHamons Thanks so much for the help. I would not have gotten there with out your help, John.

    After a bunch of attempts, I finally got it. The testing process is painful, but I guess there is no way around it. Building, manually moving things in place, building again, cleaning everything up, and then trying it and restarting the Mac to see if it worked each time.

    So glad it is working now.

Sign In or Register to comment.