简体   繁体   English

无法打开andoid.bat文件

[英]can't open andoid.bat file

I can't open android.bat file. 我无法打开android.bat文件。 I already tried: 我已经尝试过:

  1. Running the android.bat file as administrator 以管理员身份运行android.bat文件

  2. move the AVD and SDK manager from /sdk/tools/lib to the root folder /sdk 将AVD和SDK管理器从/ sdk / tools / lib移至根文件夹/ sdk

  3. Just go to SDK zip -> adt-bundle-windows-x86_64-20131030.zip, Unzip the Tools Directory only, copy it under ../sdk/ 只需转到SDK zip-> adt-bundle-windows-x86_64-20131030.zip,仅解压工具目录,然后将其复制到../sdk/

  4. reinstal android studio Reinstal Android Studio

  5. Copy your android.bat file to C:\\adt-bundle-windows-x86_64-20140702\\sdk\\tools folder or copy all files to C:\\ 将您的android.bat文件复制到C:\\ adt-bundle-windows-x86_64-20140702 \\ sdk \\ tools文件夹或将所有文件复制到C:\\

Nothing works for me. 什么都不适合我。

I also want to try this one: 我也想试试这个:

  1. the same issue when updating the Android SDK Tools and SDK Platform-tools from the SDK Manager. 从SDK Manager更新Android SDK工具和SDK平台工具时,会出现相同的问题。 I had to replace the tools folder with one located in a zip folder inside the temp folder. 我必须用位于temp文件夹中zip文件夹中的一个文件夹替换tools文件夹。

but itemp folder includes many files and i don't know what to open... 但是itemp文件夹包含许多文件,我不知道该打开什么...

  1. I also tried set java_exe="C:\\Program Files\\Java\\jdk1.7.0_11\\bin\\java.exe" but there is no set java_exe in android.bat file, code is here: 我也尝试设置java_exe =“ C:\\ Program Files \\ Java \\ jdk1.7.0_11 \\ bin \\ java.exe”,但是android.bat文件中没有set java_exe,代码在这里:

    @echo off setlocal enableDelayedExpansion @echo关闭setlocal enableDelayedExpansion

     echo ************************************************************************** echo The "android" command is deprecated. echo For manual SDK, AVD, and project management, please use Android Studio. echo For command-line tools, use tools\\bin\\sdkmanager.bat echo and tools\\bin\\avdmanager.bat echo ************************************************************************** echo. set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=.\\ if not defined wrapper_bin_dir ( set wrapper_bin_dir=bin ) set avd_verbs=;list;create;move;delete; set avd_objects=;avd;target;device; call:checkMatch "%avd_verbs%" "%avd_objects%" %* || ( call:invoke "%DIRNAME%%wrapper_bin_dir%\\avdmanager" %* || exit /b 1 exit /b 0 ) set sdk_verbs=;list;update; set sdk_objects=;sdk; call:checkMatch "%sdk_verbs%" "%sdk_objects%" %* || ( call:runSdkCommand %* || exit /b 1 exit /b 0 ) echo Invalid or unsupported command "%*" echo. echo Supported commands are: echo android list target echo android list avd echo android list device echo android create avd echo android move avd echo android delete avd echo android list sdk echo android update sdk exit /b 1 :runSdkCommand setlocal enableDelayedExpansion set trysdk="" if defined USE_SDK_WRAPPER (set trysdk="%USE_SDK_WRAPPER%") call:findSdkParam %* || ( set trysdk=y ) if %trysdk%=="" ( echo "android" SDK commands can be translated to sdkmanager commands on a best-effort basis. echo (This prompt can be suppressed with the --use-sdk-wrapper commend-line argument echo or by setting the USE_SDK_WRAPPER environment variable^) set /p trysdkresponse="Continue? [y/N]: " if /I "!trysdkresponse!"=="y" ( set trysdk=y ) ) if %trysdk%=="" ( echo Aborted exit /b 1 ) if "!verb!"=="list" ( call:invoke "%DIRNAME%%wrapper_bin_dir%\\sdkmanager" --list --verbose || exit /b 1 exit /b 0 ) if "!verb!"=="update" ( set args= set prev= set update_all=1 call:sdkUpdate %* || exit /b 1 exit /b 0 ) :sdkUpdate setlocal enableDelayedExpansion set paramsWithArgument=;-p;--obsolete;-u;--no-ui;--proxy-host;--proxy-port;-t;--filter; set verb="%~1" set object="%~2" set args= set prev="" shift & shift :sdkupdateloop if "%~1"=="" (goto:sdkupdatedone) set arg="%~1" set unquotedarg=%~1 shift if !arg!=="--use-sdk-wrapper" ( goto:sdkupdateloop ) else if !arg!=="!verb!" ( goto:sdkupdateloop ) else if !arg!=="!object!" ( goto:sdkupdateloop ) else if !arg!=="-n" ( echo "update sdk -n is not supported" exit /b 1 ) else if !arg!=="-s" ( set args=!args! --no_https ) else if !arg!=="--no-https" ( set args=!args! --no_https ) else if !arg!=="-a" ( set args=!args! --include_obsolete ) else if !arg!=="--all" ( set args=!args! --include_obsolete ) else if "!paramsWithArgument:;%unquotedarg%;=!" neq "!paramsWithArgument!" ( rem nothing ) else if "!arg:~1,1!"=="-" ( echo Unrecognized argument !arg! exit /b 1 ) else if !prev!=="--proxy-host" ( set args=!args! --proxy=http --proxy_host=!unquotedarg! ) else if !prev!=="--proxy-port" ( set args=!args! --proxy_port=!unquotedarg! ) else if !prev!=="-t" ( set has_filter=y call:parseFilter !arg! || exit /b 1 rem unquoted comma-separated lists are treated as separate args, so if rem the next arg isn't recognized as a flag, treat it as a filter element goto:sdkupdateloop ) else if !prev!=="--filter" ( set has_filter=y call:parseFilter !arg! || exit /b 1 rem unquoted comma-separated lists are treated as separate args, so if rem the next arg isn't recognized as a flag, treat it as a filter element goto:sdkupdateloop ) else ( echo Unrecognized argument !arg! exit /b 1 ) set prev=!arg! goto:sdkupdateloop :sdkupdatedone if not defined has_filter ( set args=%args% --update ) call:invoke "%DIRNAME%%wrapper_bin_dir%\\sdkmanager" %args% || exit /b 1 exit /b 0 :parseFilter for %%i in (%~1) do ( set filter=%%i if "!filter!"=="tool" ( set args=!args! tools ) else if "!filter!"=="tools" ( set args=!args! tools ) else if "!filter!"=="platform-tool" ( set args=!args! platform-tools ) else if "!filter!"=="platform-tools" ( set args=!args! platform-tools ) else if "!filter!"=="doc" ( set args=!args! docs ) else if "!filter:~0,4!"=="lldb" ( set args=!args! !filter:-=;! ) else if "!filter:~0,11!"=="build-tools" ( set args=!args! !filter:build-tools-=build-tools;! ) else if "!filter!"=="ndk" ( set args=!args! ndk-bundle ) else if "!filter:~0,8!"=="android-" ( set args=!args! platforms;!filter! ) else if "!filter:~0,6!"=="extra-" ( set tmp=!filter:extra-=extras-! set args=!args! !tmp:-=;! ) else ( echo Filter !filter! is not supported exit /b 1 ) ) exit /b 0 :findSdkParam :sdkloop if "%~1"=="" ( exit /b 0 ) set arg=%~1 shift if "%arg%"=="--use-sdk-wrapper" ( exit /b 1 ) goto:sdkloop :checkMatch set verbs=%~1 set objects=%~2 set verb="" set object="" shift & shift :loop if "%~1"=="" ( goto:done ) set arg=%~1 shift if "%arg:~0,1%"=="-" ( goto:loop ) if !verb!=="" if "!verbs:;%arg%;=!" neq "!verbs!" ( set verb=!arg! goto:loop ) if !verb! neq "" if "!objects:;%arg%;=!" neq "!objects!" ( set object=!arg! goto:done ) :done if !verb! neq "" if !object! neq "" exit /b 1 exit /b 0 :invoke echo Invoking %* echo. call %* || exit /b 1 exit /b 0 

As you can see from the android.bat code, the android command is deprecated . android.bat代码中可以看到, 不推荐使用 android命令。 You need to use Android Studio when updating all related to Android SDK. 更新所有与Android SDK相关的内容时,您需要使用Android Studio。

When you try running it, it will give the following message: 当您尝试运行它时,它将显示以下消息:

*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Invalid or unsupported command ""

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk

in the Windows, you need to run the android.bat inside the command prompt. 在Windows中,您需要在命令提示符下运行android.bat The above message is when running the android script in Linux. 以上消息是在Linux中运行android脚本时出现的。 But the result should be relative same. 但是结果应该是相对相同的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM