android - 创建 android AVD : (Permission denied) inside Ubuntu 时出错

标签 android eclipse ubuntu android-virtual-device android-sdk-tools

我是 IOS 和 Android 应用程序的初学者。

我在 Ubuntu 中安装了带有 Android SDKAVDEclipse

当我从终端启动 android 时。此调用 Android SDK Manager

我打开这个问题是因为问题出在我创 build 备 AVD 时。 我安装了两个版本的 Android:

user@user-F50Sf:~/Downloads$ android list targets
Available Android targets:
----------
id: 1 or "android-18"
     Name: Android 4.3
     Type: Platform
     API level: 18
     Revision: 2
     Skins: WXGA800, WXGA800-7in, WSVGA, WQVGA400, HVGA, WXGA720, WVGA800 (default), QVGA, WQVGA432, WVGA854
     ABIs : no ABIs.
----------
id: 2 or "android-19"
     Name: Android 4.4.2
     Type: Platform
     API level: 19
     Revision: 2
     Skins: WXGA800, WXGA800-7in, WSVGA, WQVGA400, HVGA, WXGA720, WVGA800 (default), QVGA, WQVGA432, WVGA854
     ABIs : armeabi-v7a
user@user-F50Sf:~/Downloads$  

Android SDK现在我想从终端创建新设备,但出现此错误:

 user@user-F50Sf:~/Downloads$ android create avd -n mySim -t android-19
    Auto-selecting single ABI armeabi-v7a
    Android 4.4.2 is a basic Android platform.
    Do you wish to create a custom hardware profile [no]
    Error: /home/user/.android/avd/mySim.ini (Permission denied)

当我创建新设备 AVD 时,我在 Eclipse 中也总是遇到这个错误 Image of error eclipse

更新后,我尝试在 /etc/profile 中添加 Phonepag 的路径。 但是终端仍然报错

/etc/profile

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
export PATH=${PATH}:/opt/android-sdk-linux/tools
export PATH=${PATH}:/opt/android-sdk-linux/platform-tools
export PATH=${PATH}:/usr/lib/node_modules/phonegap/bin

我哪里错了???

编辑: 使用 sudo找不到命令

sudo android create avd -n mySim -t android-19
[sudo] password for user: 
sudo: android: command not found

最佳答案

AVD 管理器无法访问 .android 文件夹。 不确定它是否是正确的解决方案,但更改文件夹的权限对我有用:

sudo chmod 777 -R /home/user/.android

这里的“用户”是正在执行 AVD 管理器的用户,很可能是您的用户。

关于android - 创建 android AVD : (Permission denied) inside Ubuntu 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21152575/

相关文章:

php - 尝试 require_once() 同一目录中的文件时出现 fatal error

c - Linux 系统调用 clock_settime(...) 在 Docker 容器中因 EPERM 失败

java - 为什么我的声音有延迟?

android - 为 list 中的 OnCreate 不匹配扩展 Android 应用程序类

java - Unity 广告返回 INVALID_ARGUMENT

android - 在Android OpenGL ES 1.1 中,如何在三角形的两边绘制纹理?

Android:如何更改使用 ViewPager 创建的项目?

java - 将 java 编译成 ,class 时出错(转到)

java - 在 eclipse 中设置测试输入

java - Eclipse 变得无响应