Skip to content

Latest commit

 

History

History
70 lines (60 loc) · 5.47 KB

_HOW-TO-BUILD-AND-DEBUG-APPS.md

File metadata and controls

70 lines (60 loc) · 5.47 KB

How to build & debug apps

Sometimes you need to debug an app with a Debug version of Uno. This is useful if you need to understand a certain behavior from Uno and pin-point de source using the debugger and eventually test some changes on a real application.

To do this, you need to recompile your app using a debug version of Uno­ (or a Release version if you prefer).

Instead of tweaking your app solution to reference the your custom Uno output (because there's many steps to follow and you will have to avoid commiting this to source control), we found a simpler way: override the nuget output folder.

HOW-TO (Steps)

** THIS PROCEDURE WILL ONLY WORK WITH PROJECTS USING project.json NUGET SYSTEM. **

  1. In your application project (the one referencing Uno):
    1. Make sure to build at least once (to ensure the nuget packages are downloaded)
    2. Check in the project.json file to get the version of the Uno.UI package. The file should look-like this:
      ...
      "dependencies": {
        "CommonServiceLocator": "1.3",
        "Uno.UI": "1.3.15142-dev",
        "Uno.UI.Tasks": "2.10.13115",
        ...
      },
      ...
      -> In this example, the version is 1.3.15142-dev.
  2. Create a file named nuget_version_override.txt and in the solution folder (where Uno.UI.sln is) and put the version number in it - on the first line and nothing else is the file.
  3. Build the project for the platform you need (or build all the solution to get all of them). See below for list of project to compile for each platform...
  4. Never commit the nuget_version_override.txt into source control. It should be ignored by default anyway.

Projects per platform

Platform Solution Folder + Project
Android (Xamarin) Uno.UI / Uno.UI.Android
iOS (Xamarin) Uno.UI / Uno.UI.iOS

Clean-up Warning

WARNING You may need to clean your %USERPROFILE%\.nuget\Packages folder after you finished, just to make sure other apps referencing the same version of Uno won't get weird results.

How to debug generators of Uno.UI.Tasks

There is a known issue for this project: Visual Studio is locking the dll file, so you cannot easily debug it.

The easiest way to debug it is :

  1. Configure the nuget_version_override.txt as described above (If you try to debug using the Uno SampleApp you don't have to do anything as it's already configured)
  2. Close/kill all your devenv.exe, msbuild.exe, and Uno.SourceGeneration.Host.exe
  3. Open a new Visual studio an open only the project src\SourceGenerators\Uno.UI.Tasks\Uno.UI.Tasks.csproj
  4. In the Debug tab of the project settings configure those:
    • Start external program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
    • Command line argmuents: [PATH_TO_YOUR_PROJECT/SOLUTION_FILE] /p:Configuration=Debug

[PATH_TO_YOUR_PROJECT/SOLUTION_FILE] can be relative to the output folder of the Uno.UI.Tasks project, so ..\..\..\..\SamplesApp\SamplesApp.Droid\SamplesApp.Droid.csproj will build the Android SampleApp