GuidesUsing Xcode with Corellium

Using Xcode with Corellium

How to use Xcode with your virtual iOS-based devices as part of your iOS testing and development processes.

If you're using the Corellium Cloud product, please ensure you are first connected to VPN with the appropriate configuration profile for the Project containing the target virtual device.

USBFlux

After connecting to VPN, download and install USBFlux application from the device's Connect page.

Once installed, launch and run USBFlux. The program will automatically detect the number of virtual devices available over the USB protocol, as displayed on the USBFlux window. If you are using the Cloud product, this number will reflect the number of iOS devices in the On state in your Project.

With USBFlux running, open Xcode.

Select "Devices and Simulators" under the "Window" menu in the top navigation bar. Your virtual device will automatically appear as a Connected Device in the left-hand panel. You'll see a "CORELLIUM" serial number in the main window, as well as the iOS version and device model.

Sync Caches Faster

If this is your first time connecting to the device, Xcode will begin copying a cache from the device. Whenever you connect a new device to Xcode, a dyld_shared_cache is downloaded from the device to Xcode in preparation for development. These files can be up to 3GB, and downloading these files over WiFi Sync or USBFlux can take a very long time. To expedite this process, you can use this free tool.

This tool first generates a list of devices connected via USB. Then, it enables you to locally download the appropriate caches for Xcode and install them in the correct location, rather than copying the caches from device itself. This tool substantially speeds up the download process.

WiFi Sync - Cloud Only

To pair your virtual device with Xcode using WiFi Sync, you will first need to enable IPv6 for your VPN configuration profile in your VPN client. If you are using Viscosity, you can do this by selecting the VPN profile, then clicking "Edit," and then checking the box for "Enable IPv6."

Before proceeding, ensure that you are connected to the correct VPN configuration profile for your Project. It is recommended to have only one virtual iOS device in your Project. Multiple devices can cause Xcode to error.

Next, ensure that you are running USBFlux, and that your device is detected correctly in the USBFlux window.

Open Xcode, and select "Devices and Simulators" under the "Window" menu in the top navigation bar. Your virtual device will appear in the list of Connected Devices on the left-hand panel.

In the main screen of the Xcode device window, check the box for "Connect via Network."

On the USBFlux app, click "Stop."

In Xcode, your device should now appear as a Detected Device with a sphere icon in the left-hand panel. If it does not appear, you may need to quit and reopen Xcode, and relaunch the "Devices and Simulators" window.

Click on your device, and then click the "Pair with iPhone" button. The code is 000-000. Click "Connect."

Your device should now appear as a Connected Device. It may take a minute for Xcode to update the device status. If it does not reappear, you may need to quit and reopen Xcode, and relaunch the "Devices and Simulators" window.

Once connected, the Xcode device window may say Error: iPhone is locked. This error message does not prevent use of the device and can be ignored.

Troubleshooting Tips

  • If you are in the cloud, always ensure you are connected to VPN with the correct configuration profile.
  • For Wi-Fi Sync, "Error: iPhone is locked" can be ignored.
  • If a device is not detected properly, try closing and reopening Xcode.
  • It is not recommended to have multiple virtual devices running at once for this process. If you need to switch between virtual devices, you may need to force stop and restart usbmuxd.