sqlite3
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكنك استخدام برنامج سطر الأوامر sqlite3
لإدارة المحتوى من وحدة تحكّم عن بُعد إلى جهازك أو من الجهاز المضيف.
قواعد بيانات SQLite التي تم إنشاؤها بواسطة تطبيقات Android. تتضمن أداة sqlite3
العديد من
أوامر مفيدة، مثل .dump
لطباعة محتويات جدول
.schema
لطباعة عبارة SQL CREATE لجدول موجود. تعطي الأداة أيضًا
القدرة على تنفيذ أوامر SQLite بسرعة.
يمكنك الرجوع إلى لغة SQLite
للحصول على التفاصيل الكاملة. لمزيد من المستندات، يُرجى زيارة
sqlite3
مواصفات لغة SQL متاحة
بواسطة SQLite.
لاستخدام sqlite3
من واجهة برمجة تطبيقات عن بُعد:
- أدخل وحدة تحكّم عن بُعد من خلال إدخال الأمر التالي:
adb [-d|-e|-s {<serialNumber>}] shell
- من وحدة التحكّم عن بُعد، شغِّل أداة
sqlite3
من خلال إدخال الأمر التالي:
sqlite3
ويمكنك اختياريًا تحديد مسار كامل لقاعدة بيانات تريد استكشافها.
يخزن المحاكي/مثيلات الجهاز قواعد بيانات SQLite في الدليل
/data/data/<package_name>/databases/
- بعد استدعاء
sqlite3
، يمكنك إصدار
والأوامر في واجهة الأوامر. للخروج والرجوع إلى واجهة الأوامر عن بُعد باستخدام أداة adb، أدخِل
exit
أو اضغط على Control+D.
مثلاً:
$ adb -s emulator-5554 shell
# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
SQLite version 3.3.12
Enter ".help" for instructions
.... enter commands, then quit...
# sqlite> .exit
ملاحظة: تحتاج إلى إذن الوصول إلى الجذر في نظام الملفات لعرض الملفات.
ضمن التسلسل الهرمي لدليل /data/data
.
لاستخدام sqlite3
محليًا بدلاً من استخدام واجهة الأوامر،
اسحب ملف قاعدة البيانات من الجهاز وابدأ تشغيل sqlite3
:
- انسخ ملف قاعدة بيانات من جهازك إلى جهازك المضيف:
adb pull <database-file-on-device>
- ابدأ تشغيل أداة
sqlite3
، لتحديد ملف قاعدة البيانات:
sqlite3 <database-file-on-host>
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# sqlite3\n\nFrom a remote shell to your device or from your host machine, use the [`sqlite3`](https://www.sqlite.org/) command-line program to manage\nSQLite databases created by Android applications. The `sqlite3` tool includes many\nuseful commands, such as `.dump` to print out the contents of a table and\n`.schema` to print the SQL CREATE statement for an existing table. The tool also gives\nyou the ability to execute SQLite commands on the fly.\n\nRefer to the [SQLite\ndocumentation](https://sqlite.org/docs.html) for full details. For additional documentation, visit\n[`sqlite3`](https://sqlite.org/cli.html) and the\n[SQL language specification](https://sqlite.org/lang.html) supported\nby SQLite.\n\nTo use `sqlite3` from a remote shell:\n\n1. Enter a remote shell by entering the following command: \n\n ```\n adb [-d|-e|-s {\u003cserialNumber\u003e}] shell\n ```\n2. From the remote shell, start the `sqlite3` tool by entering the following command: \n\n ```\n sqlite3\n ```\n\n You can also optionally specify a full path to a database that you want to explore.\n Emulator/device instances store SQLite databases in the directory\n `/data/data/\u003cpackage_name\u003e/databases/`.\n3. Once you invoke `sqlite3`, you can issue commands in the shell. To exit and return to the adb remote shell, enter `exit` or press Control+D.\n\nFor example: \n\n```\n$ adb -s emulator-5554 shell\n# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db\nSQLite version 3.3.12\nEnter \".help\" for instructions\n.... enter commands, then quit...\n# sqlite\u003e .exit\n```\n\n**Note:** You need root access to the file system to view files\nwithin the `/data/data` directory hierarchy.\n\nTo use `sqlite3` locally, instead of within a shell,\npull the database file from the device and start `sqlite3`:\n\n1. Copy a database file from your device to your host machine: \n\n ```\n adb pull \u003cdatabase-file-on-device\u003e\n ```\n2. Start the `sqlite3` tool, specifying the database file: \n\n ```\n sqlite3 \u003cdatabase-file-on-host\u003e\n ```"]]