MEmuCommand Reference Manual

      Comments Off on MEmuCommand Reference Manual

GOOD NEWS for Geeks and Programmers!!

Since MEMU Android Emulator 6.0, MEmu supports a new full-functional command MEMUC. It is designed to replace all other command interfaces like memu, memumanage, memuconsole and adb. So read this article and you will know everything about this powerful command.

memuc supports to manipulate multiple instances (VMs) such as reboot emulator, check status, install apk, run app and etc. First of all, you need to pass over the index or the name of target VM. For example:
memuc clone -i 0 (or –index 0) //The 1st VM index is 0, 2nd is 1, 3rd is 2 …
memuc remove -n MEmu_2 (or –name MEmu_2) //The 1st VM name is MEmu, 2nd is MEmu_1 …

MEMUC Reference Manual

[Chapter One] VM Management

  1. Create a new VM
    • Usage:     memuc create
    • Sample:   memuc create //Create a new VM
  2. Delete a existed VM
    • Usage:     memuc remove <-i vmindex | -n vmname>
    • Sample:   memuc remove -i 0 //Delete the MEmu VM
  3. Clone a existed VM
    • Usage:     memuc clone <-i vmindex | -n vmname>
    • Sample:   memuc clone -i 1 //Clone the MEmu_1 VM
  4. 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
  5. 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
  6. Start a existed VM
    • Usage:     memuc start <-i vmindex | -n vmname>
    • Sample:   memuc start -n MEmu_2 //Start the MEmu_2 VM
  7. Stop a running VM
    • Usage:     memuc stop <-i vmindex | -n vmname>
    • Sample:   memuc stop -n MEmu //Stop the MEmu VM
  8. Stop all running VMs
    • Usage:     memuc stopall
    • Sample:   memuc stopall //Stop all the running VMs
  9. 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.
  10. 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
  11. Sort out all VM windows
    • Usage:     memuc sortwin
    • Sample:   memuc sortwin //Sort out all VM windows

[Chapter Two] VM Configuration (when VM is shut-down)

  1. 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
  2. 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
configuration key table

[Chapter Three] VM Control (when VM is running)

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. Trigger shake
    • Usage:     memuc shake <-i vmindex | -n vmname>
    • Sample:   memuc shake -i 1 //Trigger shake in MEmu_1 VM
  7. Reboot Android
    • Usage:     memuc reboot <-i vmindex | -n vmname>
    • Sample:   memuc reboot -n MEmu_2 //Reboot MEmu_2 VM
  8. Connect internet in Android
    • Usage:     memuc connect <-i vmindex | -n vmname>
    • Sample:   memuc connect -i 2 //Connect internet in MEmu_2 VM
  9. Disconnect internet in Android
    • Usage:     memuc disconnect <-i vmindex | -n vmname>
    • Sample:   memuc disconnect -i 2 //Disconnect internet in MEmu_2 VM
  10. 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
  11. 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

[Chapter Four] 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

[END]

>> Newbie to MEmu? No worry, Getting Started
>> Need old stable release? Release Archive


>> Back to MEmu 101, everything you need to know about MEmu <<

Official Website: https://www.memuplay.com
Official Twitter: https://twitter.com/MicrovirtMEmu
Facebook Page: https://www.facebook.com/memuplayer
MEmu User Group: https://www.facebook.com/groups/memuplayer