الاختبار وتصحيح الأخطاء
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
الشروط المسبقة
معاينة المطور غير مخصصة للاستخدام في تطبيقات الإنتاج. وبالتالي، فهي تتطلب استخدام إصدار تجريبي من "خدمات Google Play". يُرجى الاطّلاع على هذا الدليل حول كيفية التسجيل في البرنامج التجريبي.
للاستفادة من تجربة على أجهزة متعدّدة واختبارها، يجب أن يكون لديك اثنان على الأقل من نظام التشغيل Android
الأجهزة (مثل هاتف وجهاز لوحي). يجب أن تستوفي الأجهزة الشروط التالية:
- أن يتم تثبيت الإصدار التجريبي من خدمات Google Play عليه
- استخدام حساب Google الأساسي نفسه
- أن تكون ميزة Quick Share مفعَّلة وأن تكون مرئية للأجهزة المجاورة
- الاقتراب من بعضها
نشر تطبيقاتك
النشر من خلال "استوديو Android"
أكمِل الخطوات التالية عند نشر المحتوى من خلال "استوديو Android":
- افتح مشروع "استوديو Android" لتطبيقك.
- انتقل إلى تشغيل > عدِّل الإعدادات. ستظهر نافذة ضبط التشغيل/تصحيح الأخطاء.
- ضِمن خيارات الإطلاق، اضبط إطلاق على التطبيق الرئيسي أو على أجهزة متعدّدة.
الأخرى.
- انقر على تطبيق، ثم حسنًا.
- انقر على تشغيل لتثبيت التطبيق على جهاز الاختبار.
النشر باستخدام سطر الأوامر
عند النشر باستخدام سطر الأوامر، كرِّر الخطوات مع جميع الأجهزة المستخدَمة في
لاختبار تجربة الأجهزة المتعددة. يفترض هذا القسم أن اسم
وحدة التطبيق هي crossdevice-app
.
./gradlew crossdevice-app:installDebug
# Start the app's activity. This example uses the sample app.
adb shell am start -n \
com.example.dtdi/com.example.crossdevice.MainActivity
نصائح لتصحيح الأخطاء
لتصحيح أخطاء التطبيق، انقر على زر تصحيح الأخطاء في "استوديو Android".
ونظرًا للطبيعة غير المتزامنة والموزعة للتجارب متعددة الأجهزة، يمكن
قد يكون من الصعب الاعتماد على تصحيح الأخطاء فقط. الاستفادة من الميزة
من التسجيل والتحليلات. تم تصميم حزمة تطوير البرامج (SDK) على جميع الأجهزة لتوفير عمليات معاودة الاتصال.
لكل من العمليات الناجحة والفاشلة، لذلك من المهم التعامل مع تلك
وعمليات الاستدعاء والمخرجات النهائية لتصحيح الأخطاء بشكل أسهل.
إذا تعذّر إتمام عملية النقل ولم تتمكّن من بدء اكتشاف الجهاز أو بدء جلسة جديدة، يمكنك محاولة تفعيل "وضع الطيران" وإيقافه لإعادة ضبط حالة المشاركة السريعة بسرعة.
مشاركة ملاحظاتك
وستكون ملاحظاتك جزءًا مهمًا من "معاينة المطوِّر" لحزمة تطوير البرامج (SDK) على جميع الأجهزة. يُرجى إبلاغنا بأي مشاكل تواجهك أو أفكار لتحسين حزمة SDK تعمل على جميع الأجهزة على Android.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Testing and debugging\n\nPreconditions\n-------------\n\nThe Developer Preview isn't intended for use in production applications. Hence, it requires using a beta version of Google Play Services. See [this guide on how to enroll in the Beta Program](https://developers.google.com/android/guides/beta-program).\n\nTo run and test multidevice experiences, you must have at least two Android\ndevices (for example, a phone and a tablet). The devices must:\n\n- Have Google Play Services Beta installed\n- Use the same primary Google Account\n- Have [Quick Share enabled](https://support.google.com/android/answer/9286773) and be visible to nearby devices\n- Be in close proximity of each other\n\nDeploy your apps\n----------------\n\n### Deploy through Android Studio\n\nWhen deploying through Android Studio, complete the following steps:\n\n1. Open the Android Studio project for your app.\n2. Go to **Run \\\u003e Edit Configurations** . The **Run/Debug Configuration** window appears.\n3. Under **Launch Options** , set **Launch** to your app main or multidevice activity.\n4. Click **Apply** , and then **OK**.\n5. Click **Run** to install the app on your test device.\n\n### Deploy using the command line\n\nWhen deploying using the command line, repeat the steps for all devices used in\ntesting the multidevice experience. This section assumes that the name of your\napp module is `crossdevice-app`. \n\n ./gradlew crossdevice-app:installDebug\n # Start the app's activity. This example uses the sample app.\n adb shell am start -n \\\n com.example.dtdi/com.example.crossdevice.MainActivity\n\nTips for Debugging\n------------------\n\nTo debug the app, click the **Debug** button in Android Studio.\n\nGiven the asynchronous and distributed nature of multidevice experiences, it\nmight be difficult to rely only on debugging. Take advantage\nof logging and analytics. The Cross device SDK is designed to provide callbacks\nfor both successful and failed operations, so it's important to handle those\ncallbacks and log outputs for easier debugging.\n\nIf your transfer failed and you can't initiate device discovery or a new session, you can try turning Airplane Mode ON and OFF to quickly reset the quick share state.\n\nShare your feedback\n-------------------\n\nYour feedback is a crucial part of the Cross device SDK Developer Preview! Let us know of [any issues](https://issuetracker.google.com/issues/new?component=1205991&template=1706309) you find or ideas for improving the Cross device SDK on Android."]]