zoukankan      html  css  js  c++  java
  • 头晕的android SDK Manager and 找不到真机

     这张图很完美!可是出问题就头晕了。

    问题场景:执行Andriod.bat出现下面界面后,然后跳出Andriod SDK的界面:

     android SDK Manager的界面就孤零零的几条记录挂在那里。就没有下一步了,就是说玩不转了。

    我们看执行的bat文件

    @echo on
    Pause 'any key'
    rem Copyright (C) 2007 The Android Open Source Project
    rem
    rem Licensed under the Apache License, Version 2.0 (the "License");
    rem you may not use this file except in compliance with the License.
    rem You may obtain a copy of the License at
    rem
    rem      http://www.apache.org/licenses/LICENSE-2.0
    rem
    rem Unless required by applicable law or agreed to in writing, software
    rem distributed under the License is distributed on an "AS IS" BASIS,
    rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    rem See the License for the specific language governing permissions and
    rem limitations under the License.
    
    rem Useful links:
    rem Command-line reference:
    rem   http://technet.microsoft.com/en-us/library/bb490890.aspx
    
    rem don't modify the caller's environment
    setlocal enableextensions
    
    rem Set up prog to be the path of this script, including following symlinks,
    rem and set up progdir to be the fully-qualified pathname of its directory.
    set prog=%~f0
    
    rem Grab current directory before we change it
    set work_dir=%cd%
    
    rem Change current directory and drive to where the script is, to avoid
    rem issues with directories containing whitespaces.
    cd /d %~dp0
    
    
    rem Check we have a valid Java.exe in the path.
    set java_exe=
    call libfind_java.bat
    if not defined java_exe goto :EOF
    
    set jar_path=libsdkmanager.jar;libswtmenubar.jar
    
    rem Set SWT.Jar path based on current architecture (x86 or x86_64)
    for /f "delims=" %%a in ('"%java_exe%" -jar libarchquery.jar') do set swt_path=lib\%%a
    
    :MkTempCopy
        rem Copy android.bat and its required libs to a temp dir.
        rem This avoids locking the tool dir in case the user is trying to update it.
        set tmp_dir=%TEMP%	emp-android-tool
        xcopy "%swt_path%" "%tmp_dir%\%swt_path%" /I /E /C /G /R /Y /Q > nul
        copy /B /D /Y libcommon.jar         "%tmp_dir%lib"          > nul
        copy /B /D /Y libcommons-codec*     "%tmp_dir%lib"          > nul
        copy /B /D /Y libcommons-compress*  "%tmp_dir%lib"          > nul
        copy /B /D /Y libcommons-logging*   "%tmp_dir%lib"          > nul
        copy /B /D /Y libdvlib.jar          "%tmp_dir%lib"          > nul
        copy /B /D /Y libgson*              "%tmp_dir%lib"          > nul
        copy /B /D /Y libguava*             "%tmp_dir%lib"          > nul
        copy /B /D /Y libhttpclient*        "%tmp_dir%lib"          > nul
        copy /B /D /Y libhttpcore*          "%tmp_dir%lib"          > nul
        copy /B /D /Y libhttpmime*          "%tmp_dir%lib"          > nul
        copy /B /D /Y liblayoutlib-api.jar  "%tmp_dir%lib"          > nul
        copy /B /D /Y liborg-eclipse-*      "%tmp_dir%lib"          > nul
        copy /B /D /Y libsdk*               "%tmp_dir%lib"          > nul
        copy /B /D /Y libswtmenubar.jar     "%tmp_dir%lib"          > nul
    
        rem jar_path and swt_path are relative to PWD so we don't need to adjust them, just change dirs.
        set tools_dir=%cd%
        cd /d "%tmp_dir%"
    
    :EndTempCopy
    
    rem The global ANDROID_SWT always override the SWT.Jar path
    if defined ANDROID_SWT set swt_path=%ANDROID_SWT%
    
    if exist "%swt_path%" goto SetPath
        echo ERROR: SWT folder '%swt_path%' does not exist.
        echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
        goto :EOF
    
    :SetPath
    rem Finally exec the java program and end here.
    REM set REMOTE_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
    call "%java_exe% %REMOTE_DEBUG%" "-Dcom.android.sdkmanager.toolsdir=%tools_dir%" "-Dcom.android.sdkmanager.workdir=%work_dir%" -classpath "%jar_path%;%swt_path%swt.jar" com.android.sdkmanager.Main %*
    
    rem EOF

    跟踪后发现目录【C:UsersUsegearAppDataLocalTemp emp-android-tool】是readonly的,把此目录的属性改成可读写覆盖的即可。

    【注意:最好FQ,因为好多资源站点不断变化中】

    说起来,蛮搞笑的。可是问题就是这样莫名其妙的。

    ==========================

    这个玩意死活出现不了。查资料,网上一大堆,慢慢查吧。

    一番折腾,真机死活出现不了。adb的啥版本低乱七八糟的。办法就是:感谢 https://www.cnblogs.com/watertaro/p/10840462.html

     ===============

     死去活来,二天时间。不怕一万,就怕万一。一切顺风顺水,可是来个意外就是死去活来。祝自己gooduck吧!

  • 相关阅读:
    C#、Java实现按字节截取字符串包含中文汉字和英文字符数字标点符号等
    百度编辑器(UEditor)自定义工具栏
    ASP.NET使用百度编辑器(UEditor)使用方法
    C#设计模式--桥接模式
    C#设计模式--外观模式
    Entity Framework6测试使用
    Entity Framework6的在线下载安装
    C#设计模式--代理模式
    php 回调函数结合闭包(匿名函数)的使用示例
    函数的可变参数实例
  • 原文地址:https://www.cnblogs.com/usegear/p/14396028.html
Copyright © 2011-2022 走看看