สร้างหรือนำเข้าโปรเจ็กต์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Android Studio for Platform (ASfP) ช่วยคุณตั้งค่าสภาพแวดล้อมการพัฒนา
สำหรับโครงการโอเพนซอร์ส Android (AOSP) หน้านี้อธิบายวิธี
เริ่มโปรเจ็กต์ใหม่หรือนำเข้าโปรเจ็กต์ที่มีอยู่
สร้างโปรเจ็กต์ใหม่
หากไม่ได้เปิดโปรเจ็กต์ ให้คลิกโปรเจ็กต์ใหม่ในหน้าจอต้อนรับ

หากมีโปรเจ็กต์เปิดอยู่แล้ว ให้เลือก ASfP > โปรเจ็กต์ > โปรเจ็กต์ใหม่
จากเมนู
กรอกรายละเอียดการกำหนดค่าโปรเจ็กต์ในวิซาร์ด 
- เส้นทางของโมดูล: ระบุเส้นทางแบบสัมบูรณ์ไปยังรูทของการชำระเงินซอร์สโค้ด AOSP (เช่น
/path/to/aosp
)
- เป้าหมายมื้อกลางวัน: ป้อนเป้าหมายมื้อกลางวันที่คุณใช้ในการสร้าง (เช่น
aosp_arm64-eng
)
- ชื่อโปรเจ็กต์: ตั้งชื่อโปรเจ็กต์ที่สื่อความหมาย
- ไดเรกทอรี / โมดูล: แสดงรายการไดเรกทอรีหรือโมดูลเริ่มต้นที่คุณต้องการรวมไว้ในโปรเจ็กต์ โดยคั่นด้วยคอมมา โดยควรเป็นเส้นทางแบบสัมพัทธ์จากรูทของที่เก็บ (เช่น
frameworks/base,
packages/apps/Settings
) คุณสามารถเพิ่มหรือปรับแต่งการเลือกนี้ได้ในภายหลัง
คลิกเสร็จสิ้น ASfP จะสร้างโครงสร้างโปรเจ็กต์และ.asfp-project
ไฟล์การกำหนดค่า
หลังจากตั้งค่าโปรเจ็กต์ครั้งแรกแล้ว คุณสามารถปรับแต่งโปรเจ็กต์เพิ่มเติมได้โดย
แก้ไขไฟล์ .asfp-project
ที่อยู่ในรูทของโปรเจ็กต์ ไฟล์นี้ช่วยให้คุณทำสิ่งต่อไปนี้ได้
- เพิ่มหรือนำไดเรกทอรีและโมดูลออก
- เปิดใช้การรองรับภาษาอื่นๆ เช่น Rust หรือ C++
- กำหนดค่าแฟล็กบิลด์และตัวแปรสภาพแวดล้อม
- ระบุแหล่งที่มาของการทดสอบ
ดูข้อมูลโดยละเอียดเกี่ยวกับตัวเลือกการกำหนดค่าทั้งหมดได้ที่ภาพรวม
โปรเจ็กต์ หลังจากแก้ไข .asfp-project
แล้ว คุณจะต้องซิงค์โปรเจ็กต์เพื่อให้การเปลี่ยนแปลงมีผล
นำเข้าโปรเจ็กต์ที่มีอยู่
ASfP ไม่มีดำเนินการ "นำเข้า" แยกต่างหาก วิธีเปิดการกำหนดค่าโปรเจ็กต์ ASfP ที่มีอยู่
- เลือก ASfP > โปรเจ็กต์ > โปรเจ็กต์ใหม่
- ในช่องชื่อโปรเจ็กต์ ให้ไปที่และเลือกไดเรกทอรี
ที่มีไฟล์
.asfp-project
ที่มีอยู่ซึ่งคุณต้องการเปิด ฟิลด์ใน
วิซาร์ดจะป้อนข้อมูลตามไฟล์ .asfp-project
ที่เลือก
- คลิกเสร็จสิ้น 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."]]