iOS Build a Simple iPhone App with Swift Running Apps On a Device Running on Device

Connecting to Xcode via Bluetooth

Hi,

Thank you from the awesome coding course! I've made a lot of progress so far! I have a question about connecting device to Xcode via Bluetooth.

I was wondering if it’s possible to connect iPhone 7 to the Xcode 8.2 via Bluetooth? The new MacBook Touchbar don’t have regular USB port and I don’t have the cable connection option available (just don’t have the right cable available). Yet, I would still like to test my app on real device. Any workarounds to this one?

I already did some googling and it seems like it used to be the case back in previous versions on Xcode, but seems like it was then removed due to some stability issues. Also somebody had got things working via iTunes, but maybe there's an easier way. Have I missed something and the option is available on the newer version?

Regards, Matias

1 Answer

Xavier D
PLUS
Xavier D
Courses Plus Student 5,840 Points

Awesome stuff...!

I mean...you don't have to pay $99 annually anymore to test on a device!

And...I have the same issue with my usb ports (but I at least I can charge at any port...I wonder if charging time would be decreased if I used two or more chargers). However, my solution was to get a usb-c to usb convertor (I bought two for my iPhone and iPad).

Once you wire your iOS device to the Mac for the first time and have your Mac trust the device, your device will be recognized by iTunes and Xcode.

Now I'm not sure about Xcode, but with iTunes, once you wired the iOS device once, you can connect wirelessly and still sync your device, but you have to wire it at least once.

Now, you could attempt to "pair" your iOS device by going Bluetooth Preference on your Macbook Touchbar, make the device discoverable, and do the same on the iOS device that you want to connect via bluetooth (i.e. go to the Settings app and select the 4th option from the top to make sure Bluetooth is on and make the device discoverable.), and once there, you can start the pairing process once you see one device show up on the other device's discovery list.

If the above doesn't work, maybe you can try connecting your MacOS and iOS device to a same wLAN (try to keep both devices on the same GHz band, 2.4 or 5 ). wLAN can be provided by a wireless router, or maybe even thru tethering to another iOS device's hotspot (i.e. the PAN, or even the wPAN). Once connected wirelessly, iTunes will recognize the device to sync.

I'm not sure if Xcode will follow the same behavior as iTunes since I haven't a chance to test but you can try it out. However, a wired connection is much faster than a wireless connection, thus hypothetically building and running your apps wirelessly will take much longer than the conventional way.