डिबग करने के लिए, यह ज़रूरी है कि ऐप्लिकेशन और डिवाइस, दोनों एक ही डेवलपर खाते में रजिस्टर हों.
डीबग करने के लिए, वेब रिसीवर ऐप्लिकेशन को लोड करने के लिए, संचालक ऐप्लिकेशन को शुरू करें और Google Cast डिवाइस पर कास्ट करें. पक्का करें कि ईमेल भेजने वाला डिवाइस और वेब डिवाइस, एक ही नेटवर्क से कनेक्ट हों.
रिमोट डीबगिंग के लिए, अपने डिवाइस से कनेक्ट करने के दो तरीके हैं:
Chrome Inspector
Chrome ब्राउज़र में, Chrome Inspector पर जाने के लिए पता फ़ील्ड में यह डालें:
chrome://inspect
उस नेटवर्क पर, Cast की सुविधा वाले डिवाइसों की सूची दिखेगी.
जिस वेब रिसीवर ऐप्लिकेशन को डीबग करना है उसके लिए डिवाइस चुनें. इसके लिए, Inspect लिंक पर क्लिक करें.
एक इंस्पेक्टर विंडो खुलेगी, जिससे आपको वेब रिसीवर ऐप्लिकेशन को रिमोट तौर पर डीबग करने की सुविधा मिलेगी.
सीधे डिवाइस के 9222 पोर्ट पर
Chrome ब्राउज़र में, पता फ़ील्ड में यह जानकारी डालें, ताकि आप सीधे उस डिवाइस पर जा सकें जिसे डीबग किया जा रहा है. अगर आपके नेटवर्क पर कई डिवाइस हैं, तो हो सकता है कि यह Chrome Inspector से ज़्यादा तेज़ हो:
<deviceIPaddress>:9222
डिवाइस का आईपी पता देखने के लिए, Google Home ऐप्लिकेशन में डिवाइस चुनें. इसके बाद, सेटिंग में जाकर जानकारी वाले सेक्शन में देखें.
वह सेशन चुनें जिसे आपको डीबग करना है. इसके लिए, उसके Remote Debugging लिंक पर क्लिक करें.
अगर Chrome रिमोट डीबगर नहीं दिखता है, तो पता बार की बाईं ओर मौजूद आइकॉन चुनें और site settings चुनें.
सेटिंग में सबसे नीचे तक स्क्रोल करें और Insecure content की सेटिंग को Allow में बदलें.
Chrome रिमोट डीबगर कंसोल में, डीबग लॉगिंग की सुविधा चालू करने के लिए, ये निर्देश डालें:
इसमें डीओएम में बदलाव करने की सुविधा के साथ-साथ, Chrome JavaScript REPL (कंसोल) की पूरी सुविधा भी काम करती है. इसकी मदद से, चल रहे वेब रिसीवर ऐप्लिकेशन में बदलाव किया जा सकता है.
जब आपका वेब रिसीवर बंद हो जाएगा (लाइफ़साइकल खत्म हो जाएगा), तो डिबगर काम करना बंद कर देगा. साथ ही, सबसे ऊपर चेतावनी वाला मैसेज दिखेगा. इस स्थिति में, डिबगर के साथ इंटरैक्ट नहीं किया जा सकता. डीबग करने की सुविधा को फिर से शुरू करने के लिए, आपको वेब रिसीवर ऐप्लिकेशन को रीस्टार्ट करना होगा. इसके बाद, इंस्पेक्टर को फिर से लोड करें.
ब्रेकपॉइंट
अपने वेब रिसीवर कोड में debugger; का इस्तेमाल करके, अपने कोड में मैन्युअल ब्रेकपॉइंट जोड़े जा सकते हैं.
लोकल कैश मेमोरी
window.location.reload(true); का इस्तेमाल करके, वेब रिसीवर ऐप्लिकेशन के कैश मेमोरी को फ़्लश करने के लिए, पेज को फिर से लोड करें.
सेशन के बीच लॉग को सेव करना
डीबगर में गियर आइकॉन पर क्लिक करके और “नेविगेट करने पर लॉग सुरक्षित रखें” के बगल में मौजूद बॉक्स को चुनकर, सेशन के बीच लॉग सुरक्षित रखे जा सकते हैं.
[[["समझने में आसान है","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-03-25 (UTC) को अपडेट किया गया."],[[["Use the Chrome Remote Debugger to debug your Cast Web Receiver application by inspecting it through `chrome://inspect` or directly accessing the device's 9222 port."],["To enable debugging, register your application and Cast device on the Google Cast SDK Developer Console, ensuring both are linked to the same developer account."],["Initiate a cast session from your sender app to the target Cast device to load the Web Receiver and allow the debugger to connect."],["Leverage the Chrome Remote Debugger's console for logging, DOM manipulation, and utilizing the JavaScript REPL for interacting with the running Web Receiver app."],["Remember to disable debug logging in production environments and avoid logging sensitive information."]]],["To debug a Cast app using Chrome Remote Debugger, first register your app and device on the Google Cast SDK Developer Console. Then, start your sender app and cast to the device to load the Web Receiver app. Connect to the device via `chrome://inspect` or directly using `\u003cdevice IP address\u003e:9222`. Select the Web Receiver session to debug and enable debug logging with `cast.framework.CastReceiverContext.getInstance().setLoggerLevel(cast.framework.LoggerLevel.DEBUG);`. Use `debugger;` for breakpoints and `window.location.reload(true);` to flush the cache. Preserve logs between sessions in the settings.\n"]]