تصحيح أخطاء رمز المنصة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوفّر "استوديو Android" أداة تصحيح أخطاء تتيح لك تنفيذ ما يلي وغير ذلك:
- اختَر جهازًا لتصحيح أخطاء تطبيقك عليه.
- يمكنك ضبط نقاط توقُّف في الرموز البرمجية لـ Java وKotlin وC/C++.
- فحص المتغيّرات وتقييم التعبيرات أثناء التشغيل
تصحيح أخطاء معالجة التطبيقات (Java)
وضِع الإصدار على جهاز أو محاكي.
يمكنك ضبط نقاط توقُّف في رمز Java أو Kotlin.
انقر على Run
> Attach Debugger to Android Process
. أزِل العلامة من المربّع بجانب Native
Debugger
.
اختَر جهازك، ثم اختَر العملية، ثم انقر على Attach
.
اضبط نقطة التوقف في الرمز البرمجي.
تصحيح أخطاء عملية النظام (C++)
وضِع الإصدار على جهاز أو محاكي.
من داخل path/to/repo/checkout
، شغِّل adb root
. يمكن تشغيل محاكي واحد فقط
أو جهاز واحد.
اضبط نقاط توقّف في الرمز الأصلي.
انقر على Run > Attach Debugger to Android Process
.
يُرجى الاطّلاع على Show system processes
.
اختَر جهازك، ثم اختَر العملية، ثم انقر على Attach
.
اضبط نقطة التوقف في الرمز البرمجي.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-01-30 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-01-30 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["Android Studio for Platform (ASfP) provides a powerful debugger that lets you:\n\n- Select a device to debug on.\n- Set breakpoints in your Java, Kotlin, and C/C++ code.\n- Examine variables and evaluate expressions at runtime.\n\nBefore you use the debugger, you must flash your build to a device or emulator.\n\nApp process (Java/Kotlin) debugging\n\nTo debug a Java or Kotlin application process:\n\n1. Set breakpoints in your Java or Kotlin code within ASfP.\n\n2. Select **Run \\\u003e Attach Debugger to Android Process** from the menu.\n\n3. In the **Choose Process** dialog, make sure the **Debug type** is set to\n **Java Only**.\n\n4. Select your device from the list.\n\n5. Choose the specific application process you want to debug.\n\n6. Click **OK**.\n\n7. Interact with the application on your device to hit the breakpoints.\n\nSystem process (C/C++) debugging\n\nTo debug a system process written in C or C++:\n\n1. Verify that you have only one device or emulator running.\n\n2. Open a terminal and run `adb root` from your AOSP checkout root: `bash\n adb root`\n\n\u003c!-- --\u003e\n\n1. Set breakpoints in your C/C++ code within ASfP.\n\n2. Select **Run \\\u003e Attach Debugger to Android Process** from the menu.\n\n3. In the **Choose Process** dialog, change the **Debug type** to **Native\n Only** or **Dual (Java + Native)**.\n\n4. Check the **Show all processes** box to see system processes.\n\n5. Select your device from the list.\n\n6. Choose the specific system process you want to debug (such as\n `surfaceflinger` or `system_server`).\n\n7. Click **OK**.\n\n8. The debugger attaches to the process. Interact with the device to hit your\n breakpoints."]]