VS2015已经出了正式版,想用来试一下cordova方面的开发。最近在看ionic这个框架,于是想能在VS2015里编辑js就好了。
下面说一下蛋疼的安装配置过程。
一、安装VS2015及Android SDK
首先Android的SDK最好提前下好,我是从另一个电脑上把已经下好的sdk复制到D盘Android目录下,这样安装VS2015的时候就不用选择SDK下载了,速度会快点。
安装VS2015的时候最好网络*一下,不然有些组件有可能会下载失败。安装的组件我没选Xamarin,这玩意太贵用不起。安装了cordova的相关组件,也要安装nodejs。当然也可以单独安装nodejs,貌似VS2015里的nodejs版本比现在官方最新版本要低。
cordova可以在VS2015里装。
二、安装ionic
然后安装ionic,打开nodejs命令行,输入
npm install -g ionic
如果在VS2015例安装过cordova这里就不用加cordova参数了。很不幸,有警告信息:
npm WARN engine cordova-js@4.0.0: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn't found in unpacked tree
应该版本不太一致,不影响使用。
我准备分别用ionic的命令行和VS2015建立两个cordova项目,比较一下异同。
三、使用ionic命令行建立项目
先用ionic命令行建个项目试试:
ionic start myApp tabs
Creating Ionic app in folder E:\Workspaces\Cordova\myApp based on tabs project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
[=============================] 100% 0.0s
Updated the hooks directory to have execute permissions
Update Config.xml
Initializing cordova project Your Ionic project is ready to go! Some quick tips: * cd into your project: $ cd myApp * Setup this project to use Sass: ionic setup sass * Develop in the browser with live reload: ionic serve * Add a platform (ios or Android): ionic platform add ios [android]
Note: iOS development requires OS X currently
See the Android Platform Guide for full Android installation instructions:
https://cordova.apache.org/docs/en/edge/guide_platforms_android_index.md.html * Build your app: ionic build <PLATFORM> * Simulate your app: ionic emulate <PLATFORM> * Run your app on a device: ionic run <PLATFORM> * Package an app using Ionic package service: ionic package <MODE> <PLATFORM> For more help use ionic --help or ionic docs Visit the Ionic docs: http://ionicframework.com/docs Create an ionic.io account to send Push Notifications and use the Ionic View app?
(Y/n): n
+---------------------------------------------------------+
+ New Ionic Updates for July 2015
+
会自动从github上下载项目模板。切换到该目录,添加android平台支持:
E:\Workspaces\Cordova\myApp>ionic platform add android
Updated the hooks directory to have execute permissions
Downloading Default Ionic Resources
Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.zip
[=============================] % .0s
Done adding default Ionic resources
Adding icons for platform: android
npm http GET https://registry.npmjs.org/cordova-android
npm http https://registry.npmjs.org/cordova-android
npm http GET https://registry.npmjs.org/cordova-android
npm http https://registry.npmjs.org/cordova-android
npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.2.tgz
npm http https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.2.tgz
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.ionicframework.myapp183819
Name: myApp
Activity: MainActivity
Android target: android-
Copying template files...
Android project created with cordova-android@4.0.
Running command: "C:\Program Files\nodejs\node.exe" E:\Workspaces\Cordova\myApp\hooks\after_prepare\010_add_platform_class.js E:\Workspaces\Cordova\myApp
add to body class: platform-android
Installing "com.ionic.keyboard" for android
Installing "cordova-plugin-console" for android
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-splashscreen" for android
Installing "cordova-plugin-whitelist" for android
Saving platform to package.json file
自动添加了几个cordova的组件。然后编译一下:
E:\Workspaces\Cordova\myApp>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" E:\Workspaces\Cordova\myApp\hooks\after_prepare\010_add_platform_class.js E:\Workspaces\Cordova\myApp
add to body class: platform-android
Running command: cmd "/s /c "E:\Workspaces\Cordova\myApp\platforms\android\cordova\build.bat""
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: cmd: Command failed with exit code
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code
at ChildProcess.whenDone (C:\Users\Xiaodi\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js::)
at ChildProcess.emit (events.js::)
at maybeClose (child_process.js::)
at Process.ChildProcess._handle.onexit (child_process.js::)
报错了,ANDROID_HOME没有配置,需要说明的是,如果先安装了Android Studio等Android的开发环境,这些变量是应该已经配置好的,因为本机没有装Android Studio所以没有配置,那在环境变量里补上。
我把Android的SDK放在了D:\Android\sdk目录下,在环境变量里添加:
ANDROID_HOME=D:\Android\sdk
还要添加java的环境变量:
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
然后在PATH里添加:
%ANDROID_HOME%;%JAVA_HOME%\bin;
然后一定要关闭当前的nodejs窗口再重新打开,不然新配置的不会起作用。
重新编译一下:
E:\Workspaces\Cordova\myApp>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" E:\Workspaces\Cordova\myApp\hooks\after_prepare\010_add_platform_class.js E:\Workspaces\Cordova\myApp
add to body class: platform-android
Running command: cmd "/s /c "E:\Workspaces\Cordova\myApp\platforms\android\cordova\build.bat""
ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1..0_55
Running: E:\Workspaces\Cordova\myApp\platforms\android\gradlew cdvBuildDebug -b E:\Workspaces\Cordova\myApp\platforms\android\build.gradle -Dorg.gradle.daemon=true
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
...........................................................................
到这个地方用了很久,在下载gradle,这里有点失误了,应该先把Android完整的开发环境配置好,应该就会省略这一步了。到现在只能慢慢等了。
后面又是一大堆下载:
Unzipping e:\Users\Xiaodi\.gradle\wrapper\dists\gradle-2.2.-all\2m8005s69iu8v0oiejfej094b\gradle-2.2.-all.zip to e:\Users\Xiaodi\.gradle\wrapper\dists\gradle-2.2.-all\2m8005s69iu8v0oiejfej094b
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/1.0.0/builder-1.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/24.0.0/lint-24.0.0.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/5.1/proguard-parent-5.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/24.0.0/sdk-common-24.0.0.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
Download https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Download https://repo1.maven.org/maven2/com/android/tools/common/24.0.0/common-24.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/1.0.0/builder-test-api-1.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/24.0.0/ddmlib-24.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/24.0.0/manifest-merger-24.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/1.0.0/builder-model-1.0.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/24.0.0/sdklib-24.0.0.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/24.0.0/lint-checks-24.0.0.pom
Download https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/5.1/proguard-base-5.1.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava/17.0/guava-17.0.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom
Download https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/24.0.0/layoutlib-api-24.0.0.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/24.0.0/dvlib-24.0.0.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/33/commons-parent-33.pom
Download https://repo1.maven.org/maven2/org/apache/apache/13/apache-13.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/24.0.0/lint-api-24.0.0.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-parent/4.0/asm-parent-4.0.pom
Download https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
Download https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/5/commons-parent-5.pom
Download https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.pom
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/11/commons-parent-11.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm/4.0/asm-4.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.2/lombok-ast-0.2.2.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/4.0/asm-tree-4.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/1.0.0/builder-1.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/24.0.0/lint-24.0.0.jar
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/24.0.0/sdk-common-24.0.0.jar
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/common/24.0.0/common-24.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/1.0.0/builder-test-api-1.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/24.0.0/ddmlib-24.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/24.0.0/manifest-merger-24.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/1.0.0/builder-model-1.0.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/24.0.0/sdklib-24.0.0.jar
我现在已经后悔了,没有先装Android Studio。
:preBuild
:compileDebugNdk
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugBuildConfig
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:compileDebugJavaע: ijЩ�����ļ�ʹ�û�����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣 :CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar
:CordovaLib:compileDebugNdk
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugJavaע: ijЩ�����ļ�ʹ�û�����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣 :preDexDebug
:dexDebug
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:cdvBuildDebug BUILD SUCCESSFUL Total time: mins 56.923 secs
Built the following apk(s):
E:\Workspaces\Cordova\myApp\platforms\android\build\outputs\apk\android-debu
g.apk
中间貌似乱码了,不过好在编译成功。中间下载花了20多分钟。
运行一下看看:
E:\Workspaces\Cordova\myApp>ionic run android
Running command: "C:\Program Files\nodejs\node.exe" E:\Workspaces\Cordova\myApp\hooks\after_prepare\010_add_platform_class.js E:\Workspaces\Cordova\myApp
add to body class: platform-android
Running command: cmd "/s /c "E:\Workspaces\Cordova\myApp\platforms\android\cordova\run.bat""
ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1..0_55 E:\Workspaces\Cordova\myApp\platforms\android\cordova\node_modules\q\q.js:
throw e;
^
Error executing "adb devices": ADB server didn't ACK * failed to start daemon * error: unknown host service ERROR running one or more of the platforms: Error: cmd: Command failed with exit code
You may not have the required environment or OS to run this project
很不幸,又报错了。不过既然已经编译成功,可以直接安装apk试试。在E:\Workspaces\Cordova\myApp\platforms\android\build\outputs\apk目录下找到apk直接安装。
具体截图就不贴了,是可以直接运行的。
以上是用ionic命令行建立项目的过程。为了减少问题产生建议大家先按照Android官方文档把Android Studio装好,这样可以少很多问题。
四、使用VS2015建立项目
下面用VS2015来建立一个cordova项目。注意如果安装VS2015的时候没有安装Android SDK,那么使用前就要先配置一下。菜单工具-选项-Tools For Apache Cordova:
有一个Run Dependency Checker,检测一下依赖项是否已经成功配置,如果之前没有自动下载Android SDK的话,肯定会报错的,点击第二项,手动配置一下ADK_HOME即可。在这里也可以看到如果ANT、Git、JAVA SDK都是由VS2015自动安装的话,这个地方就自动配置好了,如果自己手动安装就要手动配置。
用VS2015新建项目的过程就不细说了,项目模板里有。建好后可以用Ripple模拟器在Chrome里跑一下看看。
现在可以比较一下这两种方式建好的项目目录,可以看到目录结构基本是一样的:
左边为ionic命令行建立的项目,右边为VS2015建立的项目。www里面就是html+js+css,platforms目录是Android平台支持。
其实有一个更方便的方式,ionic已经提供了VS2015的项目模板:
https://visualstudiogallery.msdn.microsoft.com/b26474d5-c14d-4d69-bad5-37954538c506
然后用这个模板建个项目,可以看到项目目录基本跟空白的cordova项目是类似的,但自动增加了ionic支持,相当于根据https://github.com/driftyco/ionic-starter-tabs这个模板建了个项目。这样就方便多了。
但用这种方式建立的项目和ionic命令行建立的项目也有区别,命令行建立的项目,已经把依赖的ionic框架及Anjular框架下载到本地了,而项目模板建立的项目,页面里引用的js还是服务器上的。
时间关系没有深入研究。但终于可以用VS2015写Cordova了。希望能尽快写出一个可以运行的小app来。
VS2015+cordova+ionic安装配置的更多相关文章
-
vs2015 cordova环境安装【个人遇到的几个问题】
原文:vs2015 cordova环境安装[个人遇到的几个问题] 问题1: vs2015,设置 Debug Android 设备[真机调试] Exception in thread "m ...
-
vs2015 cordova环境安装
原文:vs2015 cordova环境安装 1.参照其他高手的来 http://www.songker.com/index.php/post/151.html VS2015安卓开发Apache Cor ...
-
VS2015 Cordova Ionic移动开发(二)
一.创建空白Cordova应用 打开VS,选择[新建项目],选择其它语言JavaScript或者TypeScript,语言的话就按个人喜好,喜欢JS就用JS,喜欢TS就用TS,推荐使用TS书写,代码结 ...
-
VS2015 Cordova Ionic移动开发(一)
一.Windows环境配置 1.如果已经安装VS2015,打开[工具]-[选项]找到Cordova选项: 运行依赖关系查看器,用来检测开发环境是否完整. 如果检测显示: 那么就是环境配置完成了.可以直 ...
-
VS2015 Cordova Ionic移动开发(三)
一.基础设置 1.修改App名称和程序起始页 打开config.xml配置文件显示如下,在[通用]选项卡中,将显示名称和起始页,修改为自己想要的名称即可. 如需直接在xml文件中修改:右击config ...
-
[转]VS2015 Cordova Ionic移动开发(一)
本文转自:https://www.cnblogs.com/UltimateAvalon/p/5328642.html 一.Windows环境配置 1.如果已经安装VS2015,打开[工具]-[选项]找 ...
-
VS2015 Cordova Ionic移动开发(五)
一.创建侧边菜单和导航项目 1.使用VS创建一个Ionic空项目,同时创建一个Ionic SideMenu和Ionic Tabs项目.将SideMenu和Tabs项目里的templates和js文件合 ...
-
VS2015 Cordova Ionic移动开发(四)
一.布局 Ionic模板提供了一个侧边栏菜单示例项目和标签选项卡示例项目.本案例将两个布局进行结合,简单介绍下Ionic的布局.Ionic采用自定义标签和标准Html标签相结合.相对于全部使用div方 ...
-
Ionic 安装部署
Ionic 安装部署 准备工作 下载安装Node.js, JDK,Apache Ant,Android SDK:编辑器用WebStorm node jdk ant 均需要加进 环境变量path中 An ...
随机推荐
-
Java程序员笔试、面试题目
1. 面向对象编程的三大特性是什么,请简要阐述 2. String 和StringBuffer的区别 3. 说出ArrayList,Vector, LinkedList的存储性能和特性 4. Coll ...
-
创建如下三个类:(People类中的三个方法分别输出一些信息,ChinaPeople 和AmericanPeople类重写父类的三个方法)。
创建如下三个类:(People类中的三个方法分别输出一些信息,ChinaPeople 和AmericanPeople类重写父类的三个方法). ackage com.chuoji.text01; pub ...
-
centos环境源码安装postgresql9.4
源码安装简要步骤 下载PostgreSQL 源码包 下载根目录地址:http://ftp.postgresql.org/ 本人选择的是当前最新版本v9.4.1:http://ftp.postgre ...
-
Microsoft Visual C++ Runtime error解决方法
1: 当出现下图时提示Microsoft Visual C++ Runtime error 2:此时不要关闭该对话框,然后打开任务管理器(Ctrl+Shift+Esc)如下图: 找到Microsoft ...
-
ASP.NET 应用程序安全
原文:http://msdn.microsoft.com/zh-cn/magazine/hh708755.aspx 一.跨站点脚本 简介 XSS 攻击是指将脚本恶意注入用户的浏览会话,这通常在用户不知 ...
- 数据库分库分表中间件 Sharding-JDBC 源码分析 —— SQL 解析(四)之插入SQL
-
Web前后端分离
第一篇博客:见谅 用自己的通俗语言讲web工程的前后端分离: 只是从自己的角度去分析,我眼中的前后端分离(可能不对) 首先要明白我们服务器和浏览器之前传输和接受的是什么: 静态文件(html,css, ...
-
Day032--Python--操作系统, process进程
多道技术背景: 提高工作效率(充分利用I/O阻塞的时间) (I: input, O: output) 同时执行多个任务 多道技术: 空间复用: 充分利用内存空间 时间复用: 充分利用I/O阻塞时 ...
-
电子表格Excel
电子表格Excel 本次课内容一.认识下Excel1.扩展名 office2007以前,扩展名是xls office2007,扩展名是xlsx 2.文件扩展名是xls或xlsx的文件,excel电子表 ...
-
【Ubuntu】VirtualBox 您没有查看“sf_VirtualDisk”的内容所需的权限。
转自:https://www.cnblogs.com/laishenghao/p/5346651.html 最终解决办法: sudo adduser lqr vboxsf 这里lqr是我的用户名 然后 ...