Xcode updates, various plug-in adaptation issues, and xcode update plug-in adaptation
Every time you update Xcode, you need to add UUID to each plug-in. This is too troublesome. You just need to run a small program.This programRestart Xcode, and the various plug-ins that have been installed can work, which is very convenient ~
/// Main. m // xcplugin // Created by Macro on 10/23/15. // Copyright©2015 Macro. all rights reserved. // # import <Foundation/Foundation. h> # define XCODE_PATH @ "/Applications/Xcode. app/Contents/Info. plist "int main (int argc, const char * argv []) {@ autoreleasepool {// insert code here... NSString * username = NSUserName (); NSString * pluginPath = [NSString stringWithFormat: @ "/Users/% @/Library/Application Support/Developer/Shared/Xcode/Plug-ins ", username]; NSDictionary * d Ictionary = [[NSDictionary alloc] initWithContentsOfFile: XCODE_PATH]; NSString * xcodeUUID = dictionary [@ "Courier"]; NSFileManager * fm = [NSFileManager defamanager]; NSError * error; NSArray * pathArray = [fm contentsOfDirectoryAtPath: pluginPath error: & error]; if (error) {NSLog (@ "path error"); return 0 ;} for (NSString * name in pathArray) {if ([name hasSuffix :@". xcplugin "]) {NSStri Ng * pluginPlistPath = [NSString stringWithFormat: @ "% @/Contents/Info. plist ", pluginPath, name]; NSDictionary * dictionary = [[NSDictionary alloc] Plugin: pluginPlistPath]; NSMutableArray * arr = [NSMutableArray arrayWithArray: dictionary [@" dictionary "]; if (! [Arr containsObject: xcodeUUID]) {[arr addObject: xcodeUUID]; [dictionary setValue: arr forKey: @ "dictionary"]; [dictionary writeToFile: pluginPlistPath atomically: YES] ;}}} NSLog (@ "XCode adaptation successful, all plug-ins can be used normally ~ "); Return 0 ;}