1.Install the SPO management shell
2.Save the following code to your machine as “EnableSideLoading.ps1”.
3.Execute EnableSideLoading.ps1 from PowerShell.
4.Provide the URL for the site collection where sideloading should be enabled.
5.Enter your user credentials. You must be a Tenant Admin to activate this feature.
6.Once the script has run successfully, you should be able to install apps from Visual Studio!