Post not yet marked as solved
I'm a newbie to Launch agent and daemons. Now I'm currently developing the remote desktop (like VNC) application for macOS with Objective-C and my application supported macOS versions are 10.6 and later. I have created a pre-login agent and it will launch my application when login window open.I am using CGEventPost to simulate keyboard and mouse events in user logged-in sessions. But it's not working in pre-login window (global login window)Citrix, LogMeIn are providing the remote controls in Pre-login window too. How are they doing it?Any help will be highly appreciated.Please refer the code//For KeyboardCGEventRef keyEvent = CGEventCreateKeyboardEvent( NULL, keyCode, down ) ;CGEventPost( kCGHIDEventTap, keyEvent ) ;CFRelease( keyEvent ) ;//For MouseCGEventRef event = CGEventCreateMouseEvent(eventSource, eventType, mouseLocation, mouseButton ); CGEventPost(kCGHIDEventTap, event);CFRelease(event);//Pre-login launch agent<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>Label</key> <string>my app label</string> <key>LimitLoadToSessionType</key> <string>LoginWindow</string> <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> <string>My app directory</string> <key>ProgramArguments</key> <array> <string>app absolute path</string> <string>service</string> <string>myservice</string> </array> <key>KeepAlive</key> <true/></dict></plist>
Post not yet marked as solved
I have created a custom ios project template wherein I get certain input fields (like name, mobile and email) from the user in the new project wizard and these fields are required for project creation.How to get the values that user has entered for these fields after project creation so that I can store them in some configuration file inside the project?MyTemplateInfo.plist<plist version="1.0">
<dict>
<key>Kind</key>
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
<key>Identifier</key>
<string>com.test</string>
<key>Ancestors</key>
<array>
<string>com.apple.dt.unit.storyboardApplication</string>
<string>com.apple.dt.unit.coreDataCocoaTouchApplication</string>
</array>
<key>Concrete</key>
<true/>
<key>Description</key>
<string>This template provides a starting point for an application that uses a single view. It provides a view controller to manage the view, and a storyboard or nib file that contains the view.</string>
<key>SortOrder</key>
<integer>1</integer>
<key>Options</key>
<array>
<dict>
<key>Description</key>
<string>Name.</string>
<key>EmptyReplacement</key>
<string>Name</string>
<key>Identifier</key>
<string>Name</string>
<key>Name</key>
<string>Name</string>
<key>NotPersisted</key>
<true/>
<key>Required</key>
<true/>
<key>Type</key>
<string>text</string>
</dict>
<dict>
<key>Description</key>
<string>Email address.</string>
<key>EmptyReplacement</key>
<string>Email</string>
<key>Identifier</key>
<string>Email</string>
<key>Name</key>
<string>Email</string>
<key>NotPersisted</key>
<true/>
<key>Required</key>
<true/>
<key>Type</key>
<string>text</string>
</dict>
<dict>
<key>Description</key>
<string>Mobile number.</string>
<key>EmptyReplacement</key>
<string>Mobile</string>
<key>Identifier</key>
<string>Mobile</string>
<key>Name</key>
<string>Mobile</string>
<key>NotPersisted</key>
<true/>
<key>Required</key>
<true/>
<key>Type</key>
<string>text</string>
</dict>
<dict>
<key>Identifier</key>
<string>languageChoice</string>
<key>Units</key>
<dict>
<key>Swift</key>
<dict>
<key>Nodes</key>
<array>
<string>AppDelegate.swift</string>
<string>ViewController.swift</string>
</array>
</dict>
</dict>
</dict>
</array>
<key>Definitions</key>
<dict>
<key>Base.lproj/Main.storyboard</key>
<dict>
<key>Path</key>
<string>Main.storyboard</string>
<key>SortOrder</key>
<integer>99</integer>
</dict>
<key>AppDelegate.swift</key>
<dict>
<key>Path</key>
<string>AppDelegate.swift</string>
</dict>
<key>ViewController.swift</key>
<dict>
<key>Path</key>
<string>ViewController.swift</string>
</dict>
</dict>
</dict>
</plist>