eclipse 如何将库添加到 Android-Emulator 的 lib 文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6054663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I add library to Android-Emulator's lib folder
提问by Viktor Apoyan
I have libTestLibrary.solibrary and I want add it to Android-emulator's libfolder. How can I do this ?
我有libTestLibrary.so库,我想将它添加到 Android 模拟器的lib文件夹中。我怎样才能做到这一点 ?
I make following steps:
我做了以下步骤:
- Window/ Open Perspective/ Other.../ DDMS
- Enter File Explorertab.
- Find libfolder and open it.
- Press Push a file onto deviceand select library which I want to push to device, but then process starts and after some seconds it's terminated and error appears:
- 窗口/打开视角/其他.../ DDMS
- 进入文件资源管理器选项卡。
- 找到lib文件夹并打开它。
- 按将文件推送到设备上并选择我想推送到设备的库,但随后进程开始并在几秒钟后终止并出现错误:
[2011-05-19 12:26:34] Failed to push selection: Read-only file system
[2011-05-19 12:26:34] Failed to push selection: Read-only file system
Added. Dear Eric:
添加。亲爱的埃里克:
I see the post that you linked but I can't understand it, can you give example of following code for my problem or explain this ?
我看到您链接的帖子,但我无法理解,您能否举例说明以下代码以解决我的问题或对此进行解释?
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
adb push su /system/xbin/su
adb shell chmod 06755 /system
adb shell chmod 06755 /system/xbin/su
adb install superuser.apk
Added.
添加。
I have write in command line:
我在命令行中写过:
C:\android\android-sdk-windows\platform-tools>adb remount
C:\android\android-sdk-windows\platform-tools>adb push libDsmShared.so /system/lib/libDsmShared.so
and error appears:
并出现错误:
failed to copy 'libDsmShared.so' to '/system/lib/libDsmShared.so': Out of memory
无法将“libDsmShared.so”复制到“/system/lib/libDsmShared.so”:内存不足
Added
添加
I have made the following steps:
我做了以下步骤:
- Launch Eclipse
- Go To: Window -> Open Perspective -> Other ...
- Select DDMSfrom the opened dialog
- Select "File explorer" tab.
- Press "Push a file onto the device" and select library which I wish to push.
Failed to push selection: Read-only file system
- Minimize all opened windows and open Command Line
- Write: cd C:\android\android-sdk-windows\platform-toolsenter
Write: abd remountenter
You will see remount successful
Maximize Eclipse and try step 5.
Failed to push selection: Out of memory
- 启动 Eclipse
- 转到:窗口 -> 打开透视图 -> 其他 ...
- 从打开的对话框中选择DDMS
- 选择“文件资源管理器”选项卡。
- 按“将文件推送到设备上”并选择我要推送的库。
推送选择失败:只读文件系统
- 最小化所有打开的窗口并打开命令行
- 写入:cd C:\android\android-sdk-windows\platform-tools输入
写:abd remount回车
你会看到重新挂载成功
最大化 Eclipse 并尝试步骤 5。
无法推送选择:内存不足
Error appears.
出现错误。
回答by Viktor Apoyan
How can I add library to Android-Emulator's lib folder
如何将库添加到 Android-Emulator 的 lib 文件夹
Operation System: Windows 7, Eclipse
操作系统:Windows 7、Eclipse
Here I present the steps how I add libraries to Android-Emulator's lib folder, it takes a week from me, but I have done all and want to share my results in order you can solve your problem very fast and effectively. So I will present steps how I done this:
在这里,我介绍了如何将库添加到 Android-Emulator 的 lib 文件夹中的步骤,这需要我一周时间,但我已经完成了所有操作,并希望分享我的结果,以便您可以非常快速有效地解决您的问题。所以我将介绍我如何做到这一点的步骤:
- Open Eclipse.
Open Command Line (cmd) and go to path there your android SDK located:
cd C:\android\android-sdk-windows\tools
Now we will run Emulator with given partition size, enter following command:
C:..\tools> emulator -avd EmulatorName -partition-size 512
NOTE:EmulatorName - is the name of your emulator.
Wait until emulator starts and minimize Command Line ( don't close it ), open new Command Line (cmd) and go to path:
cd C:\android\android-sdk-windows\platform-tools
Run the command
C:..\platform-tools> adb remount
Go to Eclipse and open
Window -> Open Perspective -> Other ...
Select DDMS in the opened Dialog.
Select "File Explorer" tab.
Select directory \system\lib
Select "Push a file onto Device" and select library(s) witch you want.
- 打开日食。
打开命令行 (cmd) 并转到您的 android SDK 所在的路径:
cd C:\android\android-sdk-windows\tools
现在我们将使用给定的分区大小运行模拟器,输入以下命令:
C:..\tools> 模拟器 -avd EmulatorName -partition-size 512
注意:EmulatorName - 是您的模拟器的名称。
等到模拟器启动并最小化命令行(不要关闭它),打开新的命令行(cmd)并转到路径:
cd C:\android\android-sdk-windows\platform-tools
运行命令
C:..\platform-tools> adb remount
转到 Eclipse 并打开
窗口 -> 打开透视图 -> 其他 ...
在打开的对话框中选择 DDMS。
选择“文件资源管理器”选项卡。
选择目录\system\lib
选择“将文件推送到设备上”并选择所需的库。
All Done !
全部完成 !
Useful links:
有用的链接:
回答by whiteShadow
In case of linux, I tried the following steps and it worked:
在 linux 的情况下,我尝试了以下步骤并且它有效:
i) Use command 'adb shell'
i) 使用命令“adb shell”
ii) traverse to '/system/xbin'
ii) 遍历到“/system/xbin”
iii) use 'ls' command to locate 'su'
iii) 使用“ls”命令定位“su”
iV) use 'su' command
iV) 使用“su”命令
V) Change permissions using 'chmod 777 /system/lib'
V) 使用 'chmod 777 /system/lib' 更改权限