目录
一.环境搭建
1.jdk安装
首先在Oracle官网上下载jdk1.8.Java Downloads | Oracle,如下图所示 我下载下面画圈的,基本点下一步就可以了,在路径选择那里可以选择自己的路径

然后在系统环境中配置jdk路径

然后在Path中添加下面
%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
然后在cmd中,输入Java -version会显示jdk版本就是成功了
2.安装Android SDK
下载链接AndroidDevTools - Android开发工具 Android SDK下载 Android Studio下载 Gradle下载 SDK Tools下载


点开安装包(右键管理员模式打开)


然后在安装目录双击打开SDK Manage.exe选择需要安装的api版本和对应的工具,这些在运行模拟器和真机测试的时候会使用到

要点击以下地方


变成上面那样后就可以进行下载了
安装好之后
若是双击“SDK Manager.exe”一直闪退,打开tools/android.bat文件修改内容如下
打开SDK的tools/目录,然后编辑Android.bat内容
@echo off
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.aspxrem don't modify the caller's environment
setlocal enableextensionsrem 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=%~f0rem 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.rem 原来的内容如下
rem set java_exe=
rem call lib\find_java.bat
rem if not defined java_exe goto :EOFrem 修改为:
set java_exe=D:\Program Files\Java\jdk-1.8\bin\java.exe
rem D:\Program Files\Java\jdk-1.8\bin\java.exe 为java的路径set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar
rem Set SWT.Jar path based on current architecture (x86 or x86_64)
for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.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%\temp-android-tool
xcopy "%swt_path%" "%tmp_dir%\%swt_path%" /I /E /C /G /R /Y /Q > nul
copy /B /D /Y lib\common.jar "%tmp_dir%\lib\" > nul
copy /B /D /Y lib\commons-codec* "%tmp_dir%\lib\" > nul
copy /B /D /Y lib\commons-compress* "%tmp_dir%\lib\" &nb

1855

被折叠的 条评论
为什么被折叠?



