vmlite-android 屏幕旋转90,How to change the screen size of vmlite android?
问题
I installed vmlite's android image which is great but there is one thing I don't find solution: How to change the screen size?
It has a fix ratio of the width/height of the screen, but I need to change it to simulate some android phones.
I searched a lot but not find a solution, please help.
UPDATE
The grub menu is as following:
cmdline (hd0,2)/cmdline
kernel --use-cmd-line (hd0,2)/kernel
initrd (hd0,2)/ramdisk
I haved add a custom size using this command:
VBoxManage.exe setextradata "android-vmlite" "CustomVideoMode1" "480x800x32"
Then add vga-ask to all of the 3 menu options, but none works.
When press b on them, it doesn't ask to choose model.
回答1:
Ok, I've done some research and finally was able to edit the virtual box image. Here's how:
If you go to vmlite image's grub entries on boot , the kernel entry (one with "kernel" keyword) has an argument --use-cmd-line , this cmdline is defined in the first entry cmdline (hd0,2)/cmdline, which is a file called cmdline placed inside boot hard disk's third partition.
This file has the kernel options:
init=/init qemu=1 console=ttyS0 console=tty0 vga=788 verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemud=ttyS1
Now you must edit this file called cmdline to change vga=788 option to vga=ask.
Editing: (on a Linux machine)
You need to install vdfuse.
sudo apt-get install virtualbox-fuse
create two empty folders somewhere.
sudo mkdir /mnt/image
sudo mkdir /mnt/partition
Then mount the virtual box image (vdi, vmdk or vhd etc) to a folder. (Lets say virtualbox disk image file is /tmp/vmlite.vmdk and we'll mount it to /mnt/image folder)
vdfuse -w -f /tmp/vmlite.vmdk /mnt/image
Some files will be created in mount folder named EntireDisk, Partition1 , Partition2, Partition3 and so on.
since we are interested in third partition, we will mount the corresponding file to /mnt/partition:
sudo mount -o loop /mnt/image/Partition3 /mnt/partition
See the contents:
sudo ls -l /mnt/partition
There'd be cmdline, ramdisk and kernel.
Now we edit the cmdline file (we'll use gedit text editor, you can use one you like):
sudo gedit /mnt/partiton/cmdline
make the edits, change vga=788 to vga=ask, save and close. Verify new file contents:
sudo cat /mnt/partition/cmdline
Unmount files and images:
sudo umount /mnt/partition
sudo umount /mnt/image
and if we don't need those two folders:
sudo rm /mnt/image
sudo rm /mnt/partition
Done, boot image from virtual box. It'll say press ENTER to view available video modes, On Enter a list is shown, type the digit of choice, or type "scan" to search for more display modes.
NOTE: Not all modes worked ,use VESA modes with color depth 24 or 32 and supported aspect ratios.
回答2:
please refer to this thread:
http://forum.xda-developers.com/showthread.php?p=19785371
You can change this file, cmdline, inside (hd0,2)
init=/init qemu=1 console=ttyS0 console=tty0 vga=788 verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemud=ttyS1
==>
init=/init qemu=1 console=ttyS0 console=tty0 vga=ask verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemud=ttyS1
Thank wingman for his detailed instructions.
Another option is to attach the vmdk file to a running linux vm (if you have one), the disk would auto mount to make life simpler.
来源:https://stackoverflow.com/questions/12493599/how-to-change-the-screen-size-of-vmlite-android
vmlite-android 屏幕旋转90,How to change the screen size of vmlite android?相关推荐
- Android屏幕旋转时Activity不重新调用onCreate的方法
2019独角兽企业重金招聘Python工程师标准>>> android屏幕旋转时Activity不重新调用onCreate的方法 当手机转屏时,Activity的onDestroy和 ...
- Android 屏幕旋转 全解析
屏幕旋转一般的解决方案 关于屏幕旋转这里,之前一直没太注意,因为根据设备会有指定的屏幕旋转策略如: 开发手机应用时一直使用强制竖屏布局 开发平板设备一直使用横屏布局 开发系统应用,一般给两套即横竖各一 ...
- 苹果屏幕旋转怎么设置_笔记本电脑维修|笔记本电脑屏幕旋转90度怎么复原
大家在使用笔记本电脑的时候,有没有遇到过这样一个问题.在某一次打开电脑的时候,突然就发现笔记本电脑的屏幕旋转了90度,而且不管打开哪个界面,都是旋转了90度的.遇到这个问题的时候,有小伙伴不知道怎么解 ...
- Android 屏幕旋转时Activity的变化
Android开发文档上专门有一小节解释这个问题.简单来说,Activity是负责与用户交互的最主要机制,任何"设置"(Configuration)的改变都可能对Activity的 ...
- 通过广播获取Android屏幕旋转事件
Android获取系统屏幕旋转的方式有几种,其中比较常见的是通过重写Activity中的onConfigurationChanged方法,但是这种方法有个缺陷,当测试程序在后台运行的时候不能 ...
- Android 屏幕旋转的处理
1. 不做任何处理的情况下 如果没有针对性地做任何处理的话,默认情况下,当用户手机的重力感应器打开后,旋转屏幕方向,会导致app的当前activity发生onDestroy-> onCreate ...
- Android屏幕旋转180°的实现
这次分享一个实现屏幕只能在竖直方向上旋转的功能,开发相机的童鞋应该都会遇到屏幕旋转的问题,一般都是横竖屏的切换,布局变换,生命周期问题啥的,这些网上一搜一大堆的解决方案,什么监听onConfigura ...
- Android 屏幕旋转方向和屏幕起始原点的关系
我们调试的平板设备大部分默认都是竖屏模式(估计是受手机影响),设备平放,系统自带开机动画界面的显示起始点即为屏幕的起始原点,就是屏幕旋转的0°角. 假定设备初始方向为竖屏模式,LCD的起始原点有可能出 ...
- android 屏幕旋转不重新加载,Android webview旋转屏幕导致页面重新加载问题解决办法...
Android webview旋转屏幕导致页面重新加载问题解决办法 1. 在create时候加个状态判断 protected void onCreate(Bundle savedInstanceSta ...
最新文章
- ivf技术_体外受精技术介绍 谁需要IVF技术帮助
- 安卓虚拟机_安卓虚拟机(*New*)v1.1.31去广告/去推荐/Mod/精简/VIP版
- html文字字号不改变,如何在不改变div大小的情况下更改HTML / css中的字体大小?...
- 《RabbitMQ实战指南》笔误及改进记录
- 导入,导出字符和数字的转换
- YII 利用Clip构建layout
- windows mac linux 木马,针对Linux Windows macOS系统Adwind木马广告攻击
- 触动精灵将图片转成base64字符串后通过post方式上传给服务器
- win7原版镜像_(超详细)WIN7原版系统win镜像安装教程
- 对于数据链路层滑动窗口协议中窗口大小的总结
- 9月20-21日,十位阿里技术大牛带你玩转大流量与高并发
- 小小白的Android入门之计算器学习
- 基于强化学习与深度强化学习的游戏AI训练
- bert:pre-training of deep bidirectional transformers for language understanding
- android 控制wifi模块,Android 控制wifi 相关操作实例
- 银河系中一定有生命存在
- 八字计算方法 php,php计算四柱(生辰八字)的方法
- 基于MATLAB的人民币面额的自动识别
- 从深度学习计算过程来分析深度学习工作站\服务器的硬件配置
- SAP UI5 图片显示控件 Avatar 的使用方式介绍试读版