プロジェクトを作成またはインポートする
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android Studio for Platform(ASfP)は、Android オープンソース プロジェクト(AOSP)の開発環境をセットアップするのに役立ちます。このページでは、新しいプロジェクトを開始する方法と既存のプロジェクトをインポートする方法について説明します。
新しいプロジェクトの作成
プロジェクトが開いていない場合は、ウェルカム画面で [New Project] をクリックします。![[New Project] オプションが表示されている ASfP のウェルカム画面](https://developer.android.com/studio/platform/images/welcome_screen.png?authuser=0&hl=ja)
すでにプロジェクトを開いている場合は、メニューから [ASfP] > [Project] > [New Project] を選択します。
ウィザードでプロジェクト構成の詳細を入力します。![ASfP の [New Project] 構成ウィザード画面](https://developer.android.com/studio/platform/images/finish_project_import_screen.png?authuser=0&hl=ja)
- モジュールのパス: AOSP ソースコードのチェックアウトのルートへの絶対パスを指定します(例:
/path/to/aosp
)。
- ランチ ターゲット: ビルドに使用するランチ ターゲットを入力します(例:
aosp_arm64-eng
)。
- プロジェクト名: プロジェクトにわかりやすい名前を付けます。
- ディレクトリ / モジュール: プロジェクトに含める初期ディレクトリまたはモジュールをカンマ区切りで指定します。これらは、リポジトリ ルートからの相対パス(
frameworks/base,
packages/apps/Settings
など)である必要があります。この選択は後で追加または絞り込むことができます。
[Finish] をクリックします。ASfP は、プロジェクト構造と .asfp-project
構成ファイルを作成します。
プロジェクトの初期設定後、プロジェクトのルートにある .asfp-project
ファイルを編集して、プロジェクトをさらにカスタマイズできます。このファイルを使用すると、次のことができます。
- ディレクトリとモジュールを追加または削除します。
- Rust や C++ などの他の言語のサポートを有効にします。
- ビルドフラグと環境変数を構成します。
- テストソースを指定します。
すべての構成オプションの詳細については、プロジェクトの概要をご覧ください。.asfp-project
を編集した後は、変更を有効にするためにプロジェクトを同期する必要があります。
既存のプロジェクトをインポートする
ASfP には個別の「インポート」アクションはありません。既存の ASfP プロジェクト構成を開くには:
- [ASfP] > [Project] > [New Project] を選択します。
- [プロジェクト名] フィールドで、開く既存の
.asfp-project
ファイルを含むディレクトリに移動して選択します。ウィザードのフィールドには、選択した .asfp-project
ファイルに基づいてデータが入力されます。
- [Finish] をクリックします。ASfP が開き、プロジェクトのインデックスが作成されます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["Android Studio for Platform (ASfP) helps you set up your development environment\nfor the [Android Open Source Project (AOSP)](https://source.android.com/). This page explains how to\nstart a new project or import an existing one.\n\nCreate a new project\n\n1. If you don't have a project open, click **New Project** on the Welcome\n screen.\n\n2. If you already have a project open, select **ASfP \\\u003e Project \\\u003e New Project**\n from the menu.\n\n3. Fill in the project configuration details in the wizard:\n\n - **Module paths:** Specify the absolute path to the root of your AOSP source code checkout (for example, `/path/to/aosp`).\n - **Lunch target:** Enter the lunch target you use for building (for example, `aosp_arm64-eng`).\n - **Project name:** Give your project a descriptive name.\n - **Directories / modules:** List the initial directories or modules you want to include in your project, separated by commas. These should be relative paths from the repository root (for example, `frameworks/base,\n packages/apps/Settings`). You can add more or refine this selection later.\n4. Click **Finish** . ASfP creates the project structure and the `.asfp-project`\n configuration file.\n\nConfigure and customize your project\n\nAfter the initial project setup, you can further customize your project by\nediting the `.asfp-project` file located in the project root. This file lets\nyou:\n\n- Add or remove directories and modules.\n- Enable support for other languages like Rust or C++.\n- Configure build flags and environment variables.\n- Specify test sources.\n\nFor detailed information on all configuration options, see the [Projects\noverview](/studio/platform/projects). After editing `.asfp-project`, you'll need to sync the project for\nthe changes to take effect.\n\nImport an existing project\n\nASfP doesn't have a separate \"import\" action. To open an existing ASfP project\nconfiguration:\n\n1. Select **ASfP \\\u003e Project \\\u003e New Project**.\n2. In the **Project Name** field, navigate to and select the directory containing the existing `.asfp-project` file you want to open. The fields in the wizard will populate based on the selected `.asfp-project` file.\n3. Click **Finish**. ASfP opens and indexes the project."]]