2012-10-11 8 views
14

मैं कुछ विकल्पों के साथ कमांड लाइन में एमुलेटर बनाना चाहता हूं, जैसे hw.mainKeys = false। मुझे इसे एक शेल स्क्रिप्ट होने की आवश्यकता है, इसलिए स्वचालन परीक्षण पर चलाया जा सकता है, हालांकि here मुझे उन मानों को सेट करने के लिए कोई स्थान नहीं मिला।विकल्पों के साथ कमांड लाइन में एंड्रॉइड एमुलेटर कैसे बनाएं?

android create avd 

उन विकल्पों को निर्दिष्ट करने के लिए कोई स्थान नहीं है।

एक वैकल्पिक एक 'मंच' प्रकार avd बनाने के लिए, तथापि, खोल एक इंटरैक्टिव खोल कि स्क्रिप्ट के लिए मानव के लिए महान लेकिन कठिन है

Android 4.1 is a basic Android platform. 
Do you wish to create a custom hardware profile [no]yes 

Name of the AVD being run: 
avd.name [<build>]: 

वहाँ कुछ उपकरण हैं मैं सिर्फ पैरामीटर के रूप में विकल्प पारित कर सकते हैं है , --hw.mainKeys false की तरह?

उत्तर

8

आप वांछित मापदंडों

hw.lcd.density=252 
sdcard.size=32M 
skin.name=NEXUS-ONE 
skin.path=platforms/android-10/skins/NEXUS-ONE 
hw.cpu.arch=arm 
hw.keyboard.lid=no 
abi.type=armeabi 
hw.keyboard=no 
vm.heapSize=24 
hw.ramSize=256 
image.sysdir.1=platforms/android-10/images/ 

आधिकारिक दस्तावेज here

+1

कैसे मैं config.ini बाद में उपयोग कर सकते हैं? –

+1

इसे मिला। इसे name.avd/फ़ोल्डर में कॉपी किया जा सकता है। धन्यवाद –

+4

अगस्त 2016 तक "एंड्रॉइड टूल" अब समर्थित नहीं है, क्योंकि दस्तावेज पृष्ठ https://developer.android.com/studio/tools/help/android.html पर एक नोट बताता है। यह एक तरफ, बताता है, मैं अभी भी ट्रैविस सीआई में ठीक से काम क्यों नहीं कर पा रहा हूं, जहां मैं कमांड लाइन से "एंड्रॉइड बिल्ड एवीडी" का उपयोग करता हूं, और दूसरी ओर, यह उत्तर पुराना बनाता है - ऐसा लगता है कि हमें इसकी आवश्यकता है एक कमांड लाइन से एमुलेटर बनाने के लिए कुछ नए तरीके के लिए सीच ... – yvolk

2

देखें here

android create avd -n Ev o4G -t 9 -c 8000MB -s 480-800 
+1

मैं नाम, लक्ष्य, त्वचा के बारे में नहीं पूछ रहा हूं। लेकिन अन्य विकल्प –

+0

यह बहिष्कृत एंड्रॉइड कमांड है, fyi। – AnneTheAgile

0

पर एक नजर डालें साथ पाठ फ़ाइल config.ini बना सकते हैं बस का उपयोग echo no | android create avd -n name -t 9

+0

मेरे लिए काम न करें (उबंटू 14.04, टूल्स 25.1.7) –

+2

आपके उत्तर के संबंध में, ओपी को पहले "एंड्रॉइड सूची लक्ष्य" चलाया जाना चाहिए और प्रासंगिक लक्ष्य का चयन करना चाहिए, उसके पास लक्ष्य संख्या 9 नहीं हो सकती है। –

3

android --help create avd से:

Usage: 
    android [global options] create avd [action options] 
    Global options: 
    -s --silent  : Silent mode, shows errors only. 
    -v --verbose : Verbose mode, shows errors, warnings and all messages. 
    --clear-cache: Clear the SDK Manager repository manifest cache. 
    -h --help  : Help on a specific command. 

       Action "create avd": 
    Creates a new Android Virtual Device. 
    Options: 
    -t --target : Target ID of the new AVD. [required] 
    -a --snapshot: Place a snapshots file in the AVD, to enable persistence. 
    -c --sdcard : Path to a shared SD card image, or size of a new sdcard for 
      the new AVD. 
    -p --path : Directory where the new AVD will be created. 
    -b --abi  : The ABI to use for the AVD. The default is to auto-select the 
      ABI if the platform has only one ABI for its system images. 
    -d --device : The optional device definition to use. Can be a device index 
      or id. 
    -n --name : Name of the new AVD. [required] 
    -s --skin : Skin for the new AVD. 
    -g --tag  : The sys-img tag to use for the AVD. The default is to 
      auto-select if the platform has only one tag for its system 
      images. 
    -f --force : Forces creation (overwrites an existing AVD) 
1

गैर पदावनत आदेश कम कमांडलाइन विकल्प हैं, लेकिन वे कर रहे हैं:

$ $ANDROID_HOME/tools/bin/avdmanager --help create 

Usage: 
     avdmanager [global options] create [action options] 
     Global options: 
    -s --silent  : Silent mode, shows errors only. 
    -v --verbose : Verbose mode, shows errors, warnings and all messages. 
    --clear-cache: Clear the SDK Manager repository manifest cache. 
    -h --help  : Help on a specific command. 

Valid actions are composed of a verb and an optional direct object: 
- create avd   : Creates a new Android Virtual Device. 

Action "create avd": 
    Creates a new Android Virtual Device. 
Options: 
    -a --snapshot: Place a snapshots file in the AVD, to enable persistence. 
    -c --sdcard : Path to a shared SD card image, or size of a new sdcard for 
       the new AVD. 
    -g --tag  : The sys-img tag to use for the AVD. The default is to 
       auto-select if the platform has only one tag for its system 
       images. 
    -p --path : Directory where the new AVD will be created. 
    -k --package : Package path of the system image for this AVD (e.g. 
       'system-images;android-19;google_apis;x86'). [required] 
    -n --name : Name of the new AVD. [required] 
    -f --force : Forces creation (overwrites an existing AVD) 
    -b --abi  : The ABI to use for the AVD. The default is to auto-select the 
       ABI if the platform has only one ABI for its system images. 
    -d --device : The optional device definition to use. Can be a device index 
       or id. 
संबंधित मुद्दे