Android Studio Setup For Cordova Mac

2021. 5. 16. 14:09카테고리 없음

Thousands of developers already use Visual Studio’s Tools for Apache Cordova—affectionately abbreviated as “TACO”—to build mobile apps for iOS, Android and Windows using a shared JavaScript codebase. Within the IDE, TACO provides everything you need to install and configure the native SDKs, preview your app, debug on emulators and devices, and even manage continuous integration/deployment via Visual Studio Team Services.

Today, we are pleased to announce new ways to build, debug and preview Cordova apps using your favorite light-weight text editor (it is your favorite, right?): VS Code and the Cordova Tools extension.

With this extension, you can debug hybrid apps, find Cordova-specific commands in the Command Palette, and use IntelliSense to browse objects, functions, and parameters. You can use it with both “stock” versions of the Apache Cordova framework and downstream frameworks like Ionic, Onsen, PhoneGap and SAP Fiori Mobile Client. Because they all use the same Cordova build systems and core runtime, the TACO extension is adaptable to the JavaScript framework of your choice.

In fact, you can even use Visual Studio Code on a project created with the full Visual Studio IDE. For example, imagine creating a Cordova project using Ionic templates with Visual Studio on a Windows machine, then opening it on an OS X or Linux machine using Visual Studio Code—making some edits—then continuing your work in the Visual Studio IDE. No matter which editor you choose, you get the full benefit of debugging, IntelliSense, and language support. How cool is that?

Visual Studio Code + Cordova Tools currently support debugging apps on emulators, simulators, and tethered devices for Android and iOS. If you ask for it (email or tweet us), Windows support will follow not too far behind. You can also attach the debugger to an app that is already running on a device; the debugger simply uses the application ID to locate the running instance.

  1. Android Development Software Setup for Mac OS X. In order to develop Android applications, you must have the following software installed on your system. Android Studio Development Bundle, or Standalone Android SDK Tools; Android Native Development Kit (NDK) Gradle installation is recommended but not required. See Gradle for more information.
  2. How to easily setup an Android development environment on a Mac? Recently I was following Cordova Android Platform Guide and I was overwhelmed with things you have to setup.

Where the Android-SDK is installed depends on how you installed it. If you downloaded the SDK through their website and then dragged/dropped the Application to your Applications folder, it's most likely here. The Android Studio Setup Wizard guides you through the rest of the setup, which includes downloading Android SDK components that are required for development. Tip: To make Android Studio available in your list of applications, select Tools > Create Desktop Entry from the Android Studio menu bar.

If you haven’t already, download and install Visual Studio Code for Mac, Windows or Linux from http://code.visualstudio.com. It’s under 50MB and on a decent network connection you’ll have it installed in under 2 minutes. Once that’s done, install the Cordova Tools extension directly from within the code editor. Simply invoke the Command Palette (Cmd+P on Mac, Ctrl+P on Windows), type “>ext install cordova”, and hit Enter.

You can, of course, contribute to improving the extension further. The Cordova Tools extension is open source, so if you run into any issues or have suggestions for new features, please open an issue or better yet, make the change and send us a pull request.

And last but not the least, we have also made some improvements in our command line tools and extensions for continuous integration optimizing your inner and outer dev loops!

We invite you all to join in our journey to grow an active community of Cordova developers to build amazing apps using TACO. Tell us what you’d like to see, and whether you are interested in testing pre-release versions of TACO. You can do this by joining our insiders program, posting issues on stack overflow, or pinging me directly via e-mail at rsalva (at) microsoft.com. We look forward to hearing from you!

Ryan J. Salva, Principal Program Manager, Visual Studio Client Tools team
Twitter: @ryanjsalva

Ryan is a Principal Program Manager working in the Visual Studio Client Tools team where he looks after HTML, CSS and JavaScript development. He comes from a 15-year career in web standards development & advocacy as an entrepreneur, developer, and graphic designer. Today, he focuses primarily on mobile app development using web technologies and Apache Cordova.

Studio

Document your code

Every project on GitHub comes with a version-controlled wiki to give your documentation the high level of care it deserves. It’s easy to create well-maintained, Markdown or rich text documentation alongside your code.

Sign up for free See pricing for teams and enterprises
  • Install Procedure

ORDER MATTERS

Android Studio For Mac Os

Please follow the installation order as it appears.

  • If you encounter issues when editing your path variables, please see this stack overflow post for some good advise as how to prevent this issue.

Studio Setup For White Background

  1. Download JDK- Java SE Development Kit - Windows x64 - (latest edition) and Install using default options
    1. Add a system variable JAVA_HOME and point it to the directory containing the contents of the JDK (example C:Program FilesJavajdk1.7.0_51)
    2. Add ;%JAVA_HOME%bin; to the Path system variable.
    3. If you have a Proxy Server, note proxy server settings and:
      1. Start --> Type Java Control Panel
      2. General Tab --> Click Network Settings...
      3. Choose the appropriate settings, 'use browser settings' may work for you.
    4. Validate Java Install:
      1. From a command prompt enter the following
      2. You should see something like :
  2. Download Apache Ant and extract to a directory on your computer. (example C:utilant)
    1. Add a system variable ANT_HOME and point it to the directory containing the contents of the ANT directory
    2. Add ;%ANT_HOME%bin; to the Path system variable.
    3. Validate Ant Install:
      1. From a command prompt enter the following
      2. You should see something like :
      3. Troubleshooting: Unable to locate tools.jar (check to see if JAVA_HOME is set properly)
  3. Download Android Studio and Install using default settings.
    1. If you have a Proxy Server, note proxy server settings and open Android Studio:
      1. File --> Settings --> (IDE Settings Section) --> HTTP Proxy
      2. Make the appropriate selection for your environment.
    2. Add a system variable ANDROID_HOME and point it to the directory containing the android sdk that's installed with Android Studio (example: C:UsersjdoeAppDataLocalAndroidandroid-studiosdk)
    3. Add the following to your Path system variable:
      1. ;%ANDROID_HOME%platform-tools;%ANDROID_HOME%tools;
  4. Download Node and Install (if you already have it installed, download and install again to update it)
    1. Clear your NPM cache (this may save some headaches):
    2. If behind a firewall, configure node to speak to the firewall by issuing the following commands:
    3. Validate Node Install:
      1. From a command prompt enter the following
      2. You should see something like :
    4. Update Node & Global Packages
      1. Update Node:
      2. Update Global Packages:
  5. Install Cordova
  6. Install Plugman
    1. If behind a firewall, configure plugman to speak to the firewall by issuing the following commands:

Create a New Android Project

  1. In a command prompt, Navigate to a folder that will hold the project (example: C:MobileApps)
  2. Create a new project:
  3. Navigate to the new project folder:
  4. Add the Android Platform:

Setup Android Emulator

  1. Bring up android config:
  2. In the packages tree, in the open Android x.x.x (APIxx) ...
    1. Select Intel x86 Atom System Image
  3. In the packages tree, in Extras..
    1. Select Intel x86 Emulator Accelerator (HAXM)
  4. Click the Install Packages button
  5. Agree to any dialogs that come up.
  6. While still in the android config, note the SDK Path, open windows explorer and navigate to that directory.
  7. Navigate to extrasintelHardware_Accelerated_Execution_Manager and run IntelHaxm.exe
  8. While still in the android config, choose tools->manage avds, switch to Device Definitions, select one, Click Create AVD, be sure to choose Intel Atom(x86) for CPU/ABI and in emulation options enable Use Host GPU, choose ok and close out..

Don't Open the project in Android Studio!

  1. When pulling from source control, make sure all files are not read only and run clean.bat in platformsandroidcordova and delete any local.properties files in any directories..this may help relieve headaches!!!

Debugging Android Apps

  1. Choose to debug using an emulator or on a device attached to the computer:
    1. Start and deploy to the android emulator:
    2. Debug using attached android device:
  2. See cordova android debug output:
  3. You can use Google Chrome Development tools to remotely inspect and debug javascript running on the device (KitKat +) or in the emulator. This is just wonderful!
    1. Update the java code to enable remote debugging
    2. Start the ADB server:
    3. Open a new chrome window, enter the following url into the addres bar:
Ignore the following:
  1. I'm feeling lazy, this page has most of the steps. Just start with the 'Welcome to Android Studio' screen shot and look at the screenshots, just choose the defaults if there's a mismatch, and you'll be good to go.
Clone this wiki locally