You will now install your app into your virtual device using the ‘tns run android –device ’ command:
To do this first make sure your Android Studio emulator is still running, then open a terminal in Visual Studio Code and navigate to your project’s folder using the ‘cd ’ command: 4) Install your app in your Android emulator, run it, and start debugging!įor our final step we need to install your app’s build into your Android emulator. (If this is your first time using Android Studio you might need to quickly create a new virtual device first). You chose a name for your project, in my case I left it by default, and you click ‘Next’ once more:Īndroid Studio will now begin to generate the index files for your project, wait a few seconds until it’s done and then get your emulator running, to do that you need to open Android Studio’s Virtual Device Manager from the top right corner of the screen, and then hit the ‘ Launch this AVD in the emulator‘ button. Then you look for the folder where you created your app’s client earlier, you select ‘Create project form existing sources’, and you click on ‘ Next’. To do that you need to click on the ‘File’ menu -> ‘New” -> ‘Import Project…’.
Now perform a fresh deploy from Visual Studio Code to update your project’s source map, you can achieve this by right-clicking your Application.app file and selecting ‘ MDK: Deploy’:ģ) Import your project into Android Studio and get your emulator running.įirst of all, you need to import your app’s project into the Android Studio workplace. This will generate a brand new ‘launch.json‘ file where you’ll once again populate the ‘appRoot’ property with the folder path to your app’s client build: Now go to your Visual Studio Code workspace and bundle your app by clicking on ‘Terminal’ -> ‘Run Build Task’ -> ‘MDK: bundle build’.įor our next step go into VSC’s ‘Debug’ tab, click on the gear icon and choose ‘MDK Debug Configuration’: You can find the value for your adminAPI by logging into your Mobile Services cockpit, clicking on ‘Important Links’ in the bottom left of your welcome screen, and then clicking on ‘Copy Admin API’: In the extension settings you need to populate the ‘Mdk: Debug App Root’ field with the folder path that contains your app’s client:Īnd then the ‘Mdk: Mobileservice’ field with the following key-value items: Now in Visual Studio Code we have a few configuration steps left before we are able to start running and debugging our app.įirst click on VSC’s ‘Extensions’ tab, look for the Mobile Development Kit extension and click on its gear icon, then select the ‘Extension Settings’ option: 2) Configure your Visual Studio Code workplace and MDK extension.
The author of the tutorial did a great job explaining how to do that so, to avoid redundancy, I won’t get into much details about it. This topic is already explained in this tutorial: Build Your Mobile Development Kit Using MDK SDK. Have the latest version of Mobile Development Kit SDK installed and build your app’s client with it.
If you still don’t know how to do this, let me point you in direction of this great tutorial: Get Started with the Mobile Development Kit.