Skip to content

Using vsimporter

Meredith Monticello edited this page Mar 16, 2017 · 14 revisions

Using vsimporter

The vsimporter tool enables you to import your Xcode project into a new Visual Studio Universal Windows Platform (UWP) app project with Objective-C support.

Import your Xcode project

  1. Make sure Chocolately is installed. See how to install the latest version [here] (https://chocolatey.org/)

  2. Get the latest version of WinObjC.Tools, the command line tools for WinObjC. Run the below command from powershell to get the latest version:

    choco upgrade WinObjC.Tools
    

    (more information about this command and its options can be found here)

  3. From powershell, navigate to the directory containing your Xcode project (.xcodeproj); As an example:

    c:\winobjc\samples\WOCCatalog
    
  4. Run vsimporter.exe

    c:\winobjc\samples\WOCCatalog> vsimporter.exe
    
  5. A Visual Studio solution file is created in your current directory. Double click this file to open your project in Visual Studio.

  6. Press Ctrl-F5 to build your app and run it on your PC.

Custom imports and other options

You can pass the -i option at the command line to run the vsimporter tool in interactive mode. Interactive mode lets you see and select the specific configurations of the Xcode project that you wish to import.

For help running vsimporter, use the -help option at the command line to see the full set of supported options.

Known issues with vsimporter

  1. –f-no-arc-objc is not supported (–f-no is unsupported for any option, as this is normally interpreted by a clang driver). To work around the issue:
  • Right click on the relevant file in the Visual Studio solution explorer

  • Select Properties

  • Select clang

    FileProperties1

  • Set Enable Objective-C ARC to No

    FileProperties2

  1. Certain build stages are ignored (although they will be logged in the console window output):
  • Shell scripts
  • Header copy stage
  • Copy file stage
  1. Absolute paths in projects may be problematic, relative paths are preferable
  2. Windows Linker flags differ from OS X
  3. Framework search paths are ignored
  4. Custom build rules are ignored
  5. Data models and asset catalogs are not currently supported
  6. Xcode 8.0 changes the underlying markup of storyboard and XIB files, causing Xib2Nib to fail. The solution is to upgrade to the latest version of Xcode which does not trigger this issue
  7. Xib2Nib does not support all controls and nodes in storyboard and XIB files: If you're running into issues with storyboard or XIB files when importing your project, please let us known by opening an issue on GitHub and attaching your XIB file or storyboard so we can tell you what's blocking the import process