This guide will show you how to prepare your computer for Astro development.
We've split the process into four parts:
- Installing Android Studio and Xcode
- Installing Node.js and Node Version Manager
- Configuring Your Project
- Verifying Your Setup
Because Astro is used to build iOS apps and you can only build iOS apps on Macs, we only support Macs for Astro development at this time.
Although you'll do most of your coding in your favorite text editor, you'll need to install the following tools to build and run your app for both Android and iOS:
- Android Studio 3.1.x
- Xcode 11.0.x. You will be prompted for your Apple ID to access the download link. When you see the page, enter "Xcode 11.0" in the search box to make the installer easier to find.
We recommend that you download these tools using a fast internet connection because their installers are very large and can take several hours to download. Follow the instructions included with each installer to complete the installation. We also recommend that you use the latest patch version of each tool.
Astro currently requires 8.10 of Node.js. We strongly recommend that you also use Node Version Manager because it allows you to easily switch between different versions of Node.js.
To install Node.js with Node Version Manager, you can follow the official install script, or you can just run these commands:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash $ nvm install 8.10 $ nvm alias default 8.10
Whenever you copy a new project to your computer (usually by cloning a GitHub repository), you'll need to run a script to configure your project and install dependencies.
native directory of your project directory, run this command:
npm run deps
(You'll only need to run this script once per project instance. Older projects might have different configuration steps, but new projects should continue to use this configuration method.)
To verify that your computer is set up correctly, follow these steps to test both the Android and iOS versions of your app.
- Launch Android Studio
Open an existing Android Studio project
- Select the
native/androidfolder inside your project files
- Gradle will now build your dependencies
- Build and run the project
- Launch Xcode
- Go to the
native/iosfolder inside your project files
- Open the
- Make sure you have selected the target that matches your project name
- Build and run the app (⌘R)