简体   繁体   English

我的物理笔记本电脑的usb端口可以连接云机吗? 我想使用 android 工作室测试 android 应用程序

[英]Can I connect my physical laptop's usb port with cloud machine? I want to test android apps using android studio

I am using android studio on cloud, and I want to run android emulator but vt-x is disabled by the provider.我在云上使用 android 工作室,我想运行 android 模拟器,但 vt-x 已被提供商禁用。 So now is there any way to run emulator?那么现在有什么方法可以运行模拟器吗? And can I connect my laptop's usb port with that cloud machine?我可以将笔记本电脑的 usb 端口与那台云机连接吗?

Yes, but none of them is easy.是的,但没有一个是容易的。

"on cloud" means that it runs on a virtual machine far, far away. “on cloud”意味着它运行在很远很远的虚拟机上。 Its host machine, by the provider, surely has vt-x, because all recent strong hardware has.它的主机,由供应商提供,肯定有 vt-x,因为所有最近的强大硬件都有。 But currently it is impossible to emulate a virtual vt-x for a virtual machine, at least for productive environments.但是目前不可能为虚拟机模拟虚拟 vt-x,至少对于生产环境来说是这样。 This is why you have no access to vt-x on the virtual machine.这就是您无法访问虚拟机上的 vt-x 的原因。

Your options:您的选择:

  1. There are various ways to transfer usb over network.有多种方法可以通过网络传输 usb。 Linux can do that quite easily, but you need Linux both on your cloud VM and on your laptop. Linux 可以很容易地做到这一点,但您的云虚拟机和笔记本电脑上都需要 Linux。 There are also various software solutions for windows. windows还有各种软件解决方案。 The problem with these is the delay.这些问题是延迟。 Some USB protocols have strict timing requirements and if your network is slow, the virtual machine might interpret it as faulty hardware.一些 USB 协议有严格的时序要求,如果您的网络很慢,虚拟机可能会将其解释为有故障的硬件。

  2. The Android emulator is a modified Qemu . Android 仿真器是经过修改的Qemu Android VMs can run even in an unmodified qemu. Android VM 甚至可以在未修改的 qemu 中运行。 It will be slow, and hard to finetune, afaik aosp does not even run in it, but lineageos yes (a link: https://android-x86.org ).它会很慢,而且很难微调,afaik aosp 甚至不能在其中运行,但是 lineageos 是的(链接: https://android-x86.org )。 As you have likely no kvm (linux kernel virtualization accelerator), but it would work.因为您可能没有 kvm(linux kernel 虚拟化加速器),但它会工作。

In your case I would try (1), if it does not work, then you need an essentially different solution.在你的情况下,我会尝试(1),如果它不起作用,那么你需要一个本质上不同的解决方案。 For example, you can script the Android Studio to deploy the compiled apk into your phone with network-based adb .例如,您可以编写 Android Studio 脚本,以使用基于网络的adb将编译后的 apk 部署到您的手机中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用ADT在笔记本电脑上测试Android HCE? - How can i test Android HCE on my Laptop using ADT? 为什么我可以在自己的笔记本电脑中运行自己的android应用程序,而这些应用程序已在使用Android Studio的学校实验室中成功运行 - Why i can run my android apps in my own laptop that are successfully run in my school lab with android studio 我无法使用 wifi 将手机与 android studio 连接来测试我的应用程序 - I can't connect my phone with android studio using wifi to test my app 如何在 Android Studio 中将我的物理设备作为模拟器运行? - How can I run my physical device as an emulator in Android studio? Android Studio AV总是无法启动吗? 如果要在笔记本电脑上运行模拟器,该怎么办? - Android studio avd always not booting? What should i do if I want to run emulator on my laptop? 我想通过 android studio 在我的应用程序中添加一些图像 - I want to add some images in my apps by android studio android studio未检测到我的物理Android设备来测试我的Android Apps - My physical Android device is not detected by android studio to test my Android Apps 使用 Chrome USB 网络共享通过 Android 手机测试 React 和 NodeJS 应用程序。 无法连接后端 - Using Chrome USB tethering to test React and NodeJS apps with Android phone. Can't connect back end 我无法将物理设备添加到 Android 工作室 - I can not add physical device to Android studio 我如何将我的真实应用程序连接到android studio,以便可以在espresso上运行测试 - How i can connect my real app an android studio so i can run espresso test on
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM