Does the iPhone support ad-hoc network mode? Can iPhones connect to one another without requiring an existing network? If so, how can I create an Ad Hoc network in my app?
-
1Do you want to do this *programmatically* (through code written in your own application), or are you looking for a standard, built-in solution? – Cody Gray - on strike Aug 14 '11 at 14:05
-
Why are people saying that iPhones cannot create networks among themselves when the Personal Hotspot feature works perfectly well? That said, there is no API for it. – Aidan Steele Aug 15 '11 at 00:16
-
@Cody, I'm doing a research project, aimed to build a p2p network between handhold devices. – Jing Aug 16 '11 at 13:27
-
@Jing: Did you find a suitable solution for this? I'm also doing a research project where I need to build an ad hoc network with mobile devices... – florian h Jun 08 '12 at 06:52
6 Answers
Updated Answer:
Have a look at the MultiPeer Connectivity Framework (documentation link) introduced in iOS 7. NSHipster has a nice write-up on it (link). Although you don't get direct network access, you can easily pass data between devices, and even use other devices to act as middlemen to other devices nearby.
Legacy Answer:
iOS devices cannot make peer-to-peer networks using the built in Settings app or available APIs. However, if you want to send data between devices in your app you have three options.
You can use Game Kit, CoreBluetooth (in limited circumstances), or you can use something like CocoaHTTPServer.

- 57,511
- 78
- 272
- 425
-
I'm working on Gamekit/Bluetooth with multi-user, crash very often. I'm trying to understand CocoaHttpServer project,sorry my networking knowledge is poor, does it means I don't need wifi hotpot around? What job does it do? – Jing Aug 16 '11 at 13:37
-
@Moshe Any thoughts as to WHY this functionality is not enabled/allowed? It seems strange to me. – David Doria Jul 11 '13 at 17:13
-
Probably limitations of earlier devices. Of course there are some surprises coming this fall. Watch session 708 from WWDC 2013. – Moshe Jul 11 '13 at 20:33
Ad Hoc networking is supported on all iOS devices, but you can not create an ad hoc network from within your application. From the list of available networks, choose the ad hoc network you want to connect to, click the arrow and choose connect automatically. Now, your device will automatically connect to this network whenever it comes within range. After this you can use the connection using regular sockets or any other networking API.

- 2,469
- 1
- 25
- 25
-
...iPhones connect to one another... Your answer implies yet another device creating a network. – Mr47 Nov 09 '12 at 14:26
-
This might have been the right answer in November 2011 but it appears to not be the case anymore... Whenever I try to connect to an ad hoc network from within Settings on the iPhone I get "Unable to join the network" message. – Art Geigel May 27 '13 at 22:56
-
1WTF, just for fun I reset my iPhone and tried to connect to the ad hoc network again and I was able to... if you're seeing the connection problem I described above may want to try this. – Art Geigel May 27 '13 at 23:11
-
For jailbroken ios you can use Mywy or Pdanet to create hadoc wifi network – SeB.Fr Feb 27 '14 at 23:22
As of iOS 7 you can use the Multipeer Connectivity Framework to connect two iPhones without an existing network. The framework will use Bluetooth, Wifi infrastructure mode, or Wifi Adhoc mode. Unfortunately, you don't have the ability to choose a transport, the framework decides on what is best.

- 86
- 6
No, stock iPhones do not support ad-hoc Wifi communication.
Yes, iPhones can connect to one another without an existing network, using Bluetooth (via the Gamekit API).

- 70,107
- 14
- 90
- 153
What you are describing is called Wifi peer-to-peer which iOS devices do not support at the moment.

- 4,145
- 10
- 42
- 66
-
2This is incorrect, it is supported, but you must specify the connection parameters in the settings app. – Andy Sep 25 '12 at 18:03
-
4No, it wasnt as it has been for several years, so you were incorrect at the time of posting. Retaliation downvotes IS REALLY BAD BEHAVIOR! You better stop this immediately and start posting correct answers, or accept that you may be wrong. We all are sometimes. – Andy Sep 28 '12 at 08:40