أخطاء APK

تثبيت ملف AAB على الهاتف

نص الخطأ

Error: cannot install .aab directly. / bundletool: Unable to find a device matching the spec / The APKs archive is signed with the debug key

السبب

ملف AAB مخصص لـ Play ولا يُثبَّت على الهاتف مباشرة. يجب تحويله إلى مجموعة APK بأداة bundletool.

الحل خطوة بخطوة

  1. نزّل bundletool وتأكد من تثبيت Java.
  2. أنشئ .apks بـ build-apks وأعطِ keystore الخاص بك للتوقيع.
  3. ثبّت على الجهاز الموصول بـ install-apks --apks=app.apks.
  4. إن احتجت APK واحدًا يعمل في كل مكان فاستخدم --mode=universal.
  5. إن لم يُعثر على جهاز ففحص adb devices.

أوامر للمثال

bundletool build-apks --bundle=app.aab --output=app.apks --ks=release.jks --ks-key-alias=release
bundletool install-apks --apks=app.apks
bundletool build-apks --bundle=app.aab --output=app.apks --mode=universal
unzip app.apks -d out

كيف لا يتكرر

احتفظ بـ AAB للتوزيع وبـ APK شامل للاختبار الداخلي.

المؤلف والترخيص: Nibras Code