32

I have been trying to connect an iPhone to Mac OS High Sierra, I've installed on VirtualBox for testing swift app I am trying to develop. However, even I connect the phone to the USB, I can't select the phone from the devices.The message in the device section says that No device connected to the mac.

So I have following questions, 1)Is it even possible to deploy and test iPhone app from mac os hosted on VirtualBox? and how to do it? 2)Are there any alternatives VMs to VirtualBox that allows me to connect my iPhone to virtual mac os for development purposes?

Thank you.

Haridu
  • 489
  • 1
  • 5
  • 7
  • Is your host system also a Mac? – Phillip Mills Jan 15 '18 at 20:20
  • no its a Windows PC. – Haridu Jan 15 '18 at 22:04
  • 3
    For me macOS Catalina's Finder on Virtualbox Finder recognizes iDevices (iPhone/iPad) on older iOSs (below iOS 10) but not on newer like iOS 12/ 13. – Janko Jun 01 '20 at 17:50
  • The same here [Catalina 10.15.3 on VirtualBox] + [iOS 13.5.1], need to use usb over ethernet. – Bruno Yuzo Aug 06 '20 at 12:38
  • 1
    Is it possible to be achieved with VirtualBox at all? I tried also using USB Network Gate, but even without it I can see my device in the About this MAC -> System Report... menu. I also see its name when I hover on the USB icon in the bottom right corner of the VirtualBox window with the VM. **But still in XCode** I don't see it listed. – Rosen Dimov Aug 27 '20 at 08:41
  • Since my case is probably similar to yours (development on XCode), I must also mention that I get *There are no devices registered in your account on the developer website. Plug in and select a device to have XCode register it* error in Project settings -> Signing & Capabilities -> Status. Some articles on the web suggest that you can deploy your app for 7 days on your iPhone for free, but I'm starting to wonder if you still need to enroll in the developer programme to do that. – Rosen Dimov Aug 27 '20 at 08:55
  • Any solutions to this? I have the same problem on windows host and BigSur guest: usb shows up in About this mac > System Report but not in Xcode. Any ideas how to fix? – Marcel Schürmann May 31 '21 at 16:00

4 Answers4

21

I've tried all the above solutions but still, my macOS on the virtual box wasn't able to recognize my physical iOS device.

For me somehow simply turning on USB tethering on my iOS device worked.

  • From the Home screen, tap Settings > Personal Hotspot. If you don't see Personal Hotspot, tap Carrier and you will see it.
  • Tap the switch next to Personal Hotspot to turn on.
  • Connect your device to the computer using the USB cable.
  • The device will automatically begin tethering after syncing is complete.
Faizan Kamal
  • 1,732
  • 3
  • 27
  • 56
8

First of all you need the Virtualbox Extension Pack.
The Extensions Pack for Virtualbox allows you to use USB devices. First download the file, called "Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack", from the Virtualbox website Download here. Then open up Virtualbox and open "Preferences" from the File menu. Go to Extensions and add the extensions file. If you're using Ubuntu, you'll need to go one step further and add your user account to the "vboxusers" group. Open the System Settings from the launcher, then go to "Users and Groups." Once there, click "Manage Groups." Reboot your system.

Setting Up USB Plug your iPhone into your computer and open up Virtualbox. Choose the machine that you want to use your iPhone with and open up the machine settings. In the left pane click the option "USB." Make sure that "Enable USB Controller" and "Enable USB 2.0 (EHCI) Controller" are both selected. Click the "Add" button on the right side of the window, which looks like a USB plug with a green plus sign, and select the iPhone. Click "OK" to close settings.

Using Your iPhone Once you've set up the USB, start your virtual machine. In the Title bar, you will see the "Devices" menu; click this and go to "USB Devices." Select your iPhone to mount it to your virtual machine. Once mounted, you can use the iPhone as you would if you were using your native OS. You can install your APP via XCode now.

Rem Galleu
  • 109
  • 1
  • 6
  • 1
    I want to try this solution but when I enable usb 2.0 instead of 3.0 my keyboard and mouse didn´t work, any ideas why? – EriK Sep 23 '19 at 16:38
  • @EriK Also for me, with usb 2.0 keyboard and mouse won't work. did you solve it? – Dror Oct 05 '19 at 06:56
  • @Dror no, I couldn't solve it :( I had to use VMWARE instead of VirtualBox, and I had to use vmware tools for install macOs, without it it didn't work. – EriK Oct 07 '19 at 17:14
  • @EriK so on wmware the Iphone is recognized? – Mr. Wizard Mar 31 '20 at 11:41
  • 1
    im treating this case as it is not possible in my vbox. got 2 problems. ios simulator just hangs at the apple logo, and ios devices do not get detected. this is not a usb issue, since my android phone can be detected in vbox. – chitgoks Apr 17 '20 at 05:40
  • Can you elaborate on the last part, **Using Your iPhone**. What Devices menu are you referring to - on the MAC or on the phone? – Rosen Dimov Aug 27 '20 at 08:39
  • 2
    No, not working for me this way with macOS Catalina and xcode 12.1 on VirtualBox. – pyfyc Jan 11 '21 at 11:29
  • somehow this does not work for me (I see the iPhone under "Devices" as checked but not in XCode "No devices connected to 'My Mac'...). I am using BigSur 11.4 and XCode 12.5 with a iPhone SE on a Windows Host). – Marcel Schürmann May 31 '21 at 16:17
2

if you're still struggling how to connect your Iphone device to a virtual-box guest MacOS. I recommend installing vmware and and install macos on that. since vmware does not have this problem at all

if you went throught alot of pain installing macos on virtualbox I recommend this tutorial which also provides you with all the file you need. it's straight forward tutorial and works all the way without any problem.

alireza easazade
  • 3,324
  • 4
  • 27
  • 35
  • Does not it require an apple developer account available for $100 as described here: https://stackoverflow.com/questions/9066784/ios-device-testing-via-vmware? – pyfyc Jan 11 '21 at 07:37
  • 1
    @pyfyc yes I just installed xcode 12.3 works fine. if you want to run your app on your iphone you don't have to pay $100. just create an account, login with your apple developer account in xode and choose your account to sign your app. i tested it and it works – alireza easazade Jan 11 '21 at 18:29
  • 1
    Thanks for your reply. However it does not work for me yet. I have installed VMWare and macOS Catalina on it. Then I installed xcode and tried my app on a virtual device - it was working fine. But when I tried to connect my iPad via usb it crashed my Pc with blue screen. I have tried the same one more time - the same result, my PC crashed again. After that my macOS does not start at all. It shows Apple logo with progress bar running up to the middle of the line and then VMWare window disappears. Very disappointed indeed. – pyfyc Jan 12 '21 at 09:03
  • Seems that I managed to connect my iPad to macOS Catalina. I tried to create a simple test project and run it on my connected iPad - it worked. But now when I try to run my real app on connected iPad it says: "Code signing is required for product type 'Application' in SDK 'iOS 14.3'". I am already logged in to my AppleId in xcode. I also tried to set Signing to 'Automatically manage signing' and then select my TeamId. But it does not help. Could you share how to sign your app in xcode 12.3? – pyfyc Jan 13 '21 at 10:54
  • I forgot to mention that the real app that I am trying to start on my connected iPad was written by another developer (many years ago) and is already signed with another AppleId. But maybe it is not valid or expired. So the question now is how to change the old signature to my own? – pyfyc Jan 13 '21 at 11:25
  • @pyfyc How do you solved the crashing problem? I have the same behaviour, when I connect the iPad to the vm it makes windows goes on blu screen. Did you find a solution? – amicoderozer May 31 '21 at 12:49
  • @pyfyc. i didn't have any crashing problem. do you have enough memory on your computer? – alireza easazade May 31 '21 at 13:09
  • 1
    @amicoderozer The idea was to reinstall VMWare without Enhanced Keyboard Feature and to change in USB settings to USB 1.1. You can read more about my experience in my comments (search for the comments from user Alexey Moskalenko) to the featured YouTube video: https://youtu.be/yuwjUv8-uGE – pyfyc Jun 07 '21 at 07:41
  • @alireza easazade, Yes, I upgraded memory to 12 Gb. So it should be Ok. Its a bug in the VMware software itself according to the thread on their official forum: https://communities.vmware.com/t5/VMware-Workstation-Pro/USB-Device-Causing-VM-s-to-Freeze-Cannot-Kill-vmware-vmx-exe/m-p/2230227 – pyfyc Jun 07 '21 at 07:48
0

For me, the only way I managed to connect my iPhone connected to a Windows 10 host to my guest MacOS Monterey Virtual Box image, was to:

  1. disconnect my phone from the Windows system and restart virtual box, if it was running.
  2. Open the virtual box VM "Settings" and under "USB" tab, make sure the USB 1.1 or USB 2.0 are selected.
  3. Under the "USB device filters", add all the available USB filter available in the add filter with all fields set list. Note that because your phone is disconnected, it won't show up there. And this is OK.
  4. Add and extra USB filter with all the fields empty
  5. Save these changes and restart the VM
  6. Once the VM is started and you are logged in, connect your phone to your host system. At this moment the VM should connect automatically to your phone, and you should be able to see the phone, as connected, in the USB connected devices list.

Note that with this approach, depending of your setup (eg: if you are using a wireless mouse connected over USB), you might end up with the mouse, mapped only to the VM, so you won't have mouse control, over the host system.

Yonoss
  • 1,242
  • 5
  • 25
  • 41