Xcode updates, various plug-in adaptation issues, and xcode update plug-in adaptation

Source: Internet
Author: User

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 ;}

 

  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.