Memu
CLI Commands:
VM Management
Create a new VM
Usage: memuc create
memuc create 44 (create certain version of Android)
memuc create 51
memuc create 71
Sample: memuc create //Create a new VM
Delete a existed VM
Usage: memuc remove <-i vmindex | -n vmname>
Sample: memuc remove -i 0 //Delete the MEmu VM
Clone a existed VM
Usage: memuc clone <-i vmindex | -n vmname>
Sample: memuc clone -i 1 //Clone the MEmu_1 VM
[v6.1.0 Update] Since 6.0.9, you can use -t to make an asynchronous request.
It will return the taskid to check taskstatus later.
Export/Backup a VM to a file
Usage: memuc export <-i vmindex | -n vmname> <ovafile>
Sample: memuc export -n MEmu_1 c:\1.ova //Export MEmu_1 VM to 1.ova file in C drive
[v6.1.0 Update] Since 6.0.9, you can use -t to make an asynchronous request. It will return the taskid to check taskstatus later.
Import/Restore a VM from a existed ova file
Usage: memuc import <ovafile>
Sample: memuc import c:\1.ova //Import a VM from 1.ova file in C drive
[v6.1.0 Update] Since 6.0.9, you can use -t to make an asynchronous request. It will return the taskid to check taskstatus later.
Start a existed VM
Usage: memuc start <-i vmindex | -n vmname> [-t]
Sample: memuc start -n MEmu_2 //Start the MEmu_2 VM
[v6.1.0 Update] Since 6.0.9, you can use -t to make an asynchronous request. It will return the taskid to check taskstatus later.
Stop a running VM
Usage: memuc stop <-i vmindex | -n vmname>
Sample: memuc stop -n MEmu //Stop the MEmu VM
[v6.1.0 Update] Since 6.0.9, you can use -t to make an asynchronous request. It will return the taskid to check taskstatus later.
Stop all running VMs
Usage: memuc stopall
Sample: memuc stopall //Stop all the running VMs
List information of all VMs
Usage: memuc listvms [–running]
[–running] List information of all running VMs
Sample: memuc listvms //List information like index, title, window handle, status, pid.
Check whether VM is running or not
Usage: memuc isvmrunning <-i vmindex | -n vmname>
Sample: memuc isvmrunning -n MEmu_3 //Check whether VM is running or not
Sort out all VM windows
Usage: memuc sortwin
Sample: memuc sortwin //Sort out all VM windows
Check asynchronous task status, like clone, export, import, start and stop.
Usage: taskstatus <taskid>
Sample: taskstatus 100 //Check the status of task 100, it will return success, running or failed.
VM Configuration (when VM is shut-down)
Get configuration data of VM
Usage: memuc getconfig <-i vmindex | -n vmname> <key>
<key> configuration key name
Sample: memuc getconfig -i 0 memory //Get the memory size of MEmu VM
Set configuration data of VM
Usage: memuc setconfig <-i vmindex | -n vmname> <key> <value>
<key> configuration key name
Sample: memuc setconfig -i 0 cpus 4 //Set the number of CPU core as 4
configuration key table
VM Control (when VM is running)
Install Apk in VM (Android)
Usage: memuc installapp <-i vmindex | -n vmname> <apkfile>
<apkfile> apk filepath
Sample: memuc installapp -n MEmu_1 c:\test.apk //Install test.apk into MEmu_1 VM
Uninstall App from VM
Usage: memuc uninstallapp <-i vmindex | -n vmname> <packagename>
<packagename> app package name
Sample: memuc uninstallapp -i 1 com.microvirt.test //Uninstall this app from MEmu_1 VM
Start App in VM
Usage: memuc startapp <-i vmindex | -n vmname> <packageactivity>
<packageactivity> app main activity
Sample: memuc startapp -i 1 com.android.settings/.Settings //Start Android settings in MEmu_1 VM
Stop App in VM
Usage: memuc stopapp <-i vmindex | -n vmname> <packagename>
<packagename> app package name
Sample: memuc stopapp -i 1 com.android.settings //Stop Android settings in MEmu_1 VM
Trigger Android keystroke
Usage: memuc sendkey <-i vmindex | -n vmname> <key>
<key> back | home | menu | volumeup | volumedown
Sample: memuc sendkey -i 0 home //Trigger home key in MEmu VM
Trigger shake
Usage: memuc shake <-i vmindex | -n vmname>
Sample: memuc shake -i 1 //Trigger shake in MEmu_1 VM
Reboot Android
Usage: memuc reboot <-i vmindex | -n vmname>
Sample: memuc reboot -n MEmu_2 //Reboot MEmu_2 VM
Connect internet in Android
Usage: memuc connect <-i vmindex | -n vmname>
Sample: memuc connect -i 2 //Connect internet in MEmu_2 VM
Disconnect internet in Android
Usage: memuc disconnect <-i vmindex | -n vmname>
Sample: memuc disconnect -i 2 //Disconnect internet in MEmu_2 VM
Input text to Android
Usage: memuc input <-i vmindex | -n vmname> <text>
Sample: memuc input -i 0 “Hello World!” //Input “Hello World!” text into MEmu VM
Execute command in Android
Usage: memuc execmd <-i vmindex | -n vmname> <guestcmd>
Sample: memuc execcmd -i 1 “getprop persist.sys.language” //Execute “getprop” command to get Android language in MEmu_1 VM
ADB command
Most likely you don’t need ADB command any longer because memuc execmd supports most of Android commands.
In addition, memuc execmd doesn’t depend on ADB server which means more stable. However, memuc adb is
still supported just in case you need a specific adb command for some reason.
Usage: memuc adb <-i vmindex | -n vmname> <adbcmd>
Sample: memuc adb -i 0 “remount” //Execute “remount” command through ADB connection