प्लैटफ़ॉर्म के कोड को डीबग करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Android Studio for Platform (ASfP) में एक दमदार डीबगर उपलब्ध है. इसकी मदद से ये काम किए जा सकते हैं:
- डीबग करने के लिए कोई डिवाइस चुनें.
- अपने Java, Kotlin, और C/C++ कोड में ब्रेकपॉइंट सेट करें.
- रनटाइम के दौरान वैरिएबल की जांच करें और एक्सप्रेशन का आकलन करें.
डीबगर का इस्तेमाल करने से पहले, आपको अपने बिल्ड को किसी डिवाइस या एम्युलेटर पर फ़्लैश करना होगा.
ऐप्लिकेशन प्रोसेस (Java/Kotlin) को डीबग करना
Java या Kotlin ऐप्लिकेशन प्रोसेस को डीबग करने के लिए:
ASfP में, अपने Java या Kotlin कोड में ब्रेकपॉइंट सेट करें.
मेन्यू में जाकर, Run > Attach Debugger to Android Process चुनें.
प्रोसेस चुनें डायलॉग में, पक्का करें कि डीबग टाइप को सिर्फ़ Java पर सेट किया गया हो.
सूची से अपना डिवाइस चुनें.
वह आवेदन प्रक्रिया चुनें जिसे डीबग करना है.
ठीक है पर क्लिक करें.
ब्रेकपॉइंट पर पहुंचने के लिए, अपने डिवाइस पर ऐप्लिकेशन से इंटरैक्ट करें.
सिस्टम प्रोसेस (C/C++) डीबग करना
C या C++ में लिखी गई सिस्टम प्रोसेस को डीबग करने के लिए:
पुष्टि करें कि सिर्फ़ एक डिवाइस या एम्युलेटर चल रहा हो.
टर्मिनल खोलें और अपने AOSP चेकआउट रूट से adb root
चलाएं: bash
adb root
ASfP में, अपने C/C++ कोड में ब्रेकपॉइंट सेट करें.
मेन्यू में जाकर, Run > Attach Debugger to Android Process चुनें.
प्रोसेस चुनें डायलॉग में, डीबग टाइप को सिर्फ़ नेटिव या ड्यूल (Java + नेटिव) पर सेट करें.
सिस्टम प्रोसेस देखने के लिए, सभी प्रोसेस दिखाएं बॉक्स पर सही का निशान लगाएं.
सूची से अपना डिवाइस चुनें.
वह सिस्टम प्रोसेस चुनें जिसे डीबग करना है. जैसे, surfaceflinger
या system_server
.
ठीक है पर क्लिक करें.
डीबगर, प्रोसेस से अटैच हो जाता है. ब्रेकपॉइंट पर पहुंचने के लिए, डिवाइस के साथ इंटरैक्ट करें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. 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) 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."]]