Samsung DeX app testing guide

Samsung DeX station and app debugging

You can't use USB debugging while the device is in the Samsung DeX station because plugging/unplugging the device willremove it from Samsung DeX mode. Instead, you can debug your app using Ethernet or Wi-Fi.
 

To debug your Samsung DeX app over Ethernet or Wi-Fi, follow Androids guide for configuring ADB bridge.

Figure 9: ADB debugging

Android Virtual Emulator

The easiest way to test if your app works properly in Samsung DeX is to use an Android Virtual emulator that has settings that match the Samsung DeX environment.

  1. 1.

    Run AVD Manager.

  2. 2.

    Click Create Virtual Device.

  3. 3.

    Select Nexus 6P.

  4. 4.

    Click >Nougat Download.

  5. 5.

    Click >Finish when the download is complete.

  6. 6.

    Select Nougat and click Next

  7. 7.

    Click Finish.

  8. 8.

    Click the Arrow icon

  9. 9.

    The emulator will load.

Running an app in the emulator

Now the app can run and check whether the layout runs well in phone mode.

To do this, run the Command Prompt and enter the following commands:

  1. 1.

    Enter : adb shell

  2. 2.

    Enter : su

  3. 3.

    Enter : setenforce 0

  4. 4.

    Enter : settings put global enable_freeform_support 1

  5. 5.

    Enter : cd /data/local/tmp

  6. 6.

    Enter : mkdir permissions

  7. 7.

    Enter : cd permissions

  8. 8.

    Enter : cp -a /system/etc/permissions/* ./

  9. 9.

    Enter : sed -e "s/live_wallpaper/freeform_window_management/" android.software.live_wallpaper.xml > freeform.xml

  10. 10.

    Enter : mount --bind . /system/etc/permissions

  11. 11.

    Wait few seconds

  12. 12.

    Enter : stop

  13. 13.

    Wait few seconds

  14. 14.

    Enter : start

  15. 15.

    After rebooting, check if the icon below appears when in viewed in the "Recent screen" menu. The app will switch into Freeform Multi-Window when you click the icon below.

  16. 16.

    Enter the following commands in Command Prompt to test the app in the same density and resolution as Samsung DeX Desktop Mode:adb shell, wm density 160, wm size 1080x1920.

  17. 17.

    Select the following icon on Emulator control panel.

  18. 18.

    Test if the app runs well in the same density and resolution as Samsung DeX Desktop mode.

  19. 19.

    If you want to return to phone mode, enter the following commands in Command Prompt: adb shell, wm density reset, wm size reset. Click on the "rotate to portrait" icon on the Emulator Control Panel.