The very first step to start development in React-Native is to install the right tools to setup the environment correctly. I’m working on MacOS Catalina and I already have Xcode 11 installed on my machine which is one of the pre-requisites to run the iOS App.
Install the following dependencies for React-Native:
The first step in your cross-platform journey is to install Visual Studio 2019 for Windows or Visual Studio 2019 for Mac. When installing Visual Studio 2019 on Windows all you need to do is select the Mobile development with.NET workload: On Visual Studio 2019 for Mac you can select to install Android and iOS. Cisco IOS Syntax Highlighting for Visual Studio Code. Install the extension with VSCode. Save a file with the.ios extension and open with VSCode. Visual Studio Marketplace. Let's take a look at building your first iOS & Android app with.NET in Visual Studio 2017. We'll look at the app's structure, creating the UI, and adding so. Visual Studio uses Xcode for building process. Publishing to App Store Connect directly from Visual Studio is not possible for now. If I want to connect real device(to visual studio as targeted device) to create IPA file do I need to connect it in Mac or PC(Via USB cable) in order to get in VS PC. You need to connect your device to Mac. Create rich native apps using.NET across iOS, Android & Windows. Share code across device platforms with.NET Standard. Share UI with Xamarin.Forms and XAML for maximum code reuse. Debug Unity from Visual Studio with the world-class Visual Studio debugger to set breakpoints and evaluate variables and complex expressions, and leverage all.
NodeJS: https://nodejs.org/en/download/
The recommended way to install Node is using Homebrew from your Terminal:
Watchman: In react-native, Watchman watches the source code for any changes and rebuilds them.
Install XCode from App Store.
Cocoapods: This is the Dependency Manager for iOS & Mac projects.
This requires you to enter system password.
Install Visual Studio Code for Mac from here. You might face issues on Mac OS Catalina to run VS Code due to Notarization requirements. You can check out this post for more details.
Create the folder inside say your Documents folder on your Mac as below:
Open VS Code and open New Terminal and type the following command to create a new React-Native App:
Come back to the MyApp folder and run the below command to run your App in the iOS simulator:
This will install and launch the App in your iOS simulator. The first time might be very slow. It might be helpful to launch your simulator beforehand.
Running on Android:
Install the Android Studio from here, which will install the Android SDK and the required emulator. I’m using the Android 10 emulator for Pixel XL.
Open the MyApp folder in VS Code to make further changes.
Issues
Running the Android App causes issues while launching the Emulator. The error message is: React Native adb reverse ENOENT
Starting with macOS Catalina, your Mac uses zsh as the default login shell and interactive shell. You can make zsh the default in earlier versions of macOS as well.
So on your Mac:
1 – Open your .zshrc file:
2 – if .zshrc file doesn’t exist, you need to create one & open again(Step 1)
3 – Add this to your .zshrc file
4 – Save and close
5 – Compile your changes Flip html5.
& make sure to restart your terminal.
Run the command in the Terminal and you’ll see something like below if everything is fine:
Android Debug Bridge version 1.0.41
Version 30.0.0-6374843
Installed as /Users/<username>/Library/Android/sdk/platform-tools/adb
You can also run the code in your VS Code Terminal and see the same output.
The path to Android SDK is available in the Configure button -> SDK Manager (at the bottom right) when you launch Android Studio.
We are happy to announce the preview of Uno Platform support for Visual Studio Code, following the progress made by the .NET team on the Visual Studio Code WebAssembly debugger integration.
This blog will walk you through the set-up process for building and debugging WebAssembly apps with Uno wherever Visual Studio Code runs – Windows, Linux or macOS. Also, it is important to note that by using Visual Studio Code, you will be able to create or edit only your Web (WebAssembly) Uno Platform projects.
For those new to Uno Platform – it enables for creation of single-source C# and XAML apps which run natively on iOS and Android, and Web via WebAssembly. Uno Platform is Open Source (Apache 2.0) and available on GitHub. To learn more about Uno Platform, see how it works, or create a small sample app.
You can view the up-to-date version of this content on our documentation site.
1. Launch Code, then in the terminal type the following to install the Uno Platform templates:
Note that this command was updated since the original publication of this article. If the command below did not work, try re-running it to update to the latest templates. You can see the latest stable release at Uno Platform release history.
2. In the terminal type the following to create a new project:
This will create a solution that only contains the WebAssembly platform support. You should be seeing a screen like this in your Visual Studio Code.
1. Install the C# extension and the JavaScript Debugger (Nightly) extension with the debug.javascript.usePreview setting set to true (File / Preference / Settings, search for Use preview).
2. Open Code using
3. Code will ask to restore the nuget packages
1. In MainPage.xaml, replace the Grid content with the following:
2. In your MainPage.xaml.cs, add the following method:
1. Open the Debug tab in code
2. In the Run combo box, start the “.NET Core Launch (Uno Platform App)”
3. Once the build has finished you can Ctrl+Click on the http://localhost:5000 url in the build output
This is what you should see:
1. Starting the app with the WebAssembly debugger is a two-step process:
i. Start the app first using the “.NET Core Launch (Uno Platform App)” launch configuration
ii. Then start the browser using the “.NET Core Debug Uno Platform WebAssembly in Chrome” launch configuration (requires Chrome). To use the latest stable release of Edge instead of Chrome, change the type of the launch configuration in .vscode/launch.json from pwa-chrome to pwa-msedge
2. Place a breakpoint in the OnClick method
3. Click the button in the app, and the breakpoint will hit
You’ll notice that the context variables are available, and call stack frames view are also showing the C# frames. You can click on any of those and through the magic of Source Link, the C# code of Uno or Mono will be shown in the editor window, for the currently running version of the binaries.
With your sample application running and your environment set up you are now in position to edit your existing Uno web app. For the purpose of this exercise we will modify the Uno platform Getting Started app.
1. Clone the https://github.com/unoplatform/Uno.GettingStartedTutorial
2. Use the same command line above to create a project with the same name as your current project, in a different location.
3. Once created, copy the generated .vscode folder next to your .sln file
4. Update the Uno.UI package version to 2.2.0-dev.489 or later version
5. Update the Uno.Wasm.Bootstrap package to 1.2.0-dev.29 or later version
Note: the package version was updated to reflect a Linux a macOS deployment issue.
6. Add the following item in the same item group as the other nuget packages:
7. In your Wasm project file, if you had a <DotNetCliToolReference … /> line, remove it
8. You should now be in the same configuration as the generated template files.
Enjoy using VS Code and Uno!
Jerome Laban, on behalf of Uno Platform Team