android-cli
ما الذي تفعله
تُرشد هذه المهارة إلى تثبيت أداة سطر الأوامر android واستخدامها. تساعد في إنشاء مشاريع Android وتثبيت التطبيقات على الأجهزة، وإدارة المحاكيات ومكونات SDK. وهي موجهة لمطوري Android الذين يعملون من الطرفية.
متى تستخدمها
- ✓عندما تريد إنشاء مشروع Android جديد من سطر الأوامر.
- ✓عندما تحتاج إلى تثبيت ملف APK على جهاز أو محاكٍ وتشغيله.
- ✓عندما تريد تثبيت حزم Android SDK أو تحديثها من الطرفية.
رابط المهارة
https://github.com/android/skills/blob/main/devtools/android-cli/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“ثبّت أداة سطر الأوامر android وجهّز حزم SDK التي أحتاج إليها لهذا المشروع.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تتحقق المهارة أولًا من وجود أداة android في المسار، وتثبتها إذا لم تكن موجودة. ثم تعطيك الأوامر الخاصة بإدارة SDK وإنشاء المشاريع ومهام الأجهزة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
This skill provides instructions for using the android CLI tool. The tool
includes various commands for creating projects, running applications,
interacting with devices, and managing the CLI environment.
Installation
If the android tool is not in the path, install it. To install run the following command:
- Linux x86-64: curl -fsSL https://dl.google.com/android/cli/latest/linux_x86_64/install.sh | bash
- Linux ARM64: curl -fsSL https://dl.google.com/android/cli/latest/linux_arm64/install.sh | bash
- Mac Arm: curl -fsSL https://dl.google.com/android/cli/latest/darwin_arm64/install.sh | bash
- Mac Intel: curl -fsSL https://dl.google.com/android/cli/latest/darwin_x86_64/install.sh | bash
- Windows: curl -fsSL https://dl.google.com/android/cli/latest/windows_x86_64/install.cmd -o "%TEMP%\i.cmd" && "%TEMP%\i.cmd"
SDK management
To manage the installation of Android SDKs and tools, use the sdk command.
For example:
android sdk install <package>[@<version>]...: Install specific packages. Multiple packages can be specified, separated by spaces.<version>defaults to latest. For example:android sdk install platforms/android-30@2 platforms/android-34android sdk update [<pkg-name>]: Update a specific package or all packages to the latest version.android sdk remove <pkg-name>: Remove a package from the local SDK.android sdk list --all: List installed and available SDK packages.
Project creation
Create projects from templates using the create command.
For example: android create empty-activity --name="My App" --output=./my-app
Interacting with Android devices
Use the android layout command to inspect the UI layout of an Android
application in JSON format. Use the android screen command to visually inspect
the UI and obtain bounding coordinates for visual regions.
android layout dumps the UI as JSON. android screen capture -o <file path> saves a PNG.
Both auto-select the device when only one is connected; with more than one, pass --device=<serial> (use adb devices to list serials).
UI Dump
android layout returns a JSON tree of the UI elements on screen.
Each JSON object represents a UI element in the Android app. The following properties may be present:
text- any literal text the element containsresource-id- the Android resource id used to refer to the elementcontent-desc- a description of a UI element for use by accessibility toolsinteractions- the set of user interactions the element supports. May contain one or more of:CHECKABLE,CLICKABLE,FOCUSABLE,SCROLLABLE,LONG-CLICKABLE,PASSWORDstate- the set of states the element is in. May contain one or more ofCHECKED,FOCUSED,SELECTEDbounds- the screen coordinates of the bounding rectangle of the element, in the format[min X,min Y][max X, max Y]center- the screen coordinates of the center of the element, in the format[x,y]off-screen- if true, the element is in the UI hierarchy but not within the bounds of the screen; it may require scrolling to view.hidden- if true, the element is in the UI hierarchy but not visible or interactive on screen.
Use layout as a primary means of examining an Android app.
By default, layout only returns elements that have content or are interactive:
- elements with non-empty
textorcontent-descproperties - elements with non-empty
interactionsorstateTo return all elements, use the--fullflag
If layout continues to fail, use android screen capture --annotate to inspect the app.
Screenshot
android screen capture -o <file path> (or --output=<file path>) saves a PNG of the current device screen to <file path>.
Use screen capture as a secondary means of examining an Android app
Examples:
- Understanding the content of an on-screen image
- Looking at a
WebView(web content does not always appear in the ui dump) - Trying to find a UI element by its visual appearance
IMPORTANT : Always VISUALLY examine the PNG image returned from any android screen command BEFORE doing anything else.
Annotated Screenshot
android screen capture --annotate -o <file path> (or -a -o <file path>)
android screen resolve --screenshot <path> --string <string>
The --annotate command adds numerical labels and bounding boxes around UI elements. Use this command to locate UI elements that cannot
be located in the layout output.
To refer to these labels in i
الأسئلة الشائعة
أي الأنظمة يمكنها تثبيتها؟
تذكر المهارة برامج تثبيت لأنظمة Linux وMac وWindows، مع إصدارات لمعالجات Intel وARM عند الحاجة.
هل تستطيع إدارة المحاكيات؟
نعم. تستطيع الأداة إدارة أجهزة Android الافتراضية، بما في ذلك أخذ لقطات الشاشة وفحص ما يظهر عليها.
كيف أحدّث حزم SDK؟
استخدم أمر android sdk update، فيحدّث حزمة واحدة أو كل الحزم إلى أحدث إصدار.
التفاصيل
الوصف الأصلي من المؤلف
Provides instructions for installing and using the `android` CLI. The `android` command-line tool is a critical tool for Android development and helps you create new Android projects, install APKs onto devices and emulators and launch and run apps on them, manage and interact with Android virtual devices (including screenshots and UI inspection), manage Android SDK components, look up official Android documentation, and discover and install official Android skills.
repo: android/skills
الشعبية
- نجوم GitHub
- 10k
- الترتيب
- #11915
- الترخيص
- Apache-2.0
- آخر تحديث
- 29/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
agp-9-upgrade
10kيساعد وكيلك على ترقية تطبيق Android إلى Android Gradle Plugin 9 ومعالجة التغييرات الجذرية فيه. لا يناسب مشاريع Multiplatform.
camerax
10kيساعد وكيلك على بناء ميزات الكاميرا في Android باستخدام CameraX، بما في ذلك تسجيل الفيديو وأدوات الأجهزة وتأثيرات ML Kit وMedia3.
android-for-cars-parked-apps
10kيساعد وكيلك على تكييف تطبيق فيديو أو لعبة أو متصفح في Android ليعمل كتطبيق متوقف على Android Auto وAndroid Automotive.
appfunctions
10kيساعد وكيلك على إيجاد أهم المسارات في تطبيق Android وعرضها كـ AppFunctions يمكن لوكلاء الذكاء الاصطناعي وأوامر الصوت تشغيلها.
مهارات مشابهة
android-clean-architecture
280kينظّم وكيلك مشاريع أندرويد بكفاءة، ويبني الشيفرة بطريقة تجعل الصيانة وإضافة الميزات الجديدة أسهل.
compose-multiplatform-patterns
280kيساعد وكيلك على استعمال أنماط Compose Multiplatform وJetpack Compose في مشاريع KMP، وتشمل الحالة والتنقل والتصميم والأداء.
dart-flutter-patterns
280kيساعد وكيلك على كتابة شيفرة تطبيقات Dart وFlutter، باستعمال أنماط حديثة لبناء تطبيقات متينة وسهلة الإدارة.