Testing AirPrint from your iOS apps

Recently while working on our iOS app we had to integrate AirPrint feature in the app to let the user print some documents from the app. AirPrint is an Apple technology that lets you print documents from your iOS and MAC devices without requiring any additional software. The printer needs to be AirPrint capable and many latest printers have adopted the technology. A full list can be found here http://support.apple.com/kb/ht4356.

But if you are stuck with a printer which is not AirPrint compatible (check your printer model in the link above to see if it is indeed AirPrint compatible or not), you can still test your app with that printer. Thanks to my teammate for pointing me to this useful software called handyPrint which helps you with exactly this issue.

For testing from an iOS simulator:

1. Your MAC machine needs to be on the same network as your printers.

2. So, before handyPrint, if you go to your iOS app on the simulator and try to search for a printer, it will show you the below message. Even though printers are available on your network, they are not AirPrint compatible.

Screen Shot 2014-05-06 at 3.54.40 PM Screen Shot 2014-05-06 at 3.54.50 PM

3. Download and install handyPrint from http://www.netputing.com/applications/handyprint-v5/

Screen Shot 2014-05-06 at 3.56.13 PM

4. Open handyPrint. It will show you your network printers. Turn the switch it displays to ON. You will see a green light below with the text ‘Sharing’.

Screen Shot 2014-05-06 at 3.56.54 PM

You will notice that this is a trial version of handyPrint valid for just 14 days. You can purchase the full license with a very small donation (as less as 5$).

5. Now go back to your app on the simulator and click on Search Printers. This time it will show up both the printers that are being displayed on handyPrint. Select any printer you like and give a print command and it will all work.

Screen Shot 2014-05-06 at 3.57.13 PM

For testing from an iOS device:

1. Make sure handyPrint is installed and your printers are shared as detailed above.

2. On your MAC, click on the wifi option and click on ‘Create Network’.

Screen Shot 2014-05-06 at 3.59.16 PM

3. Enter a name for the network and click create.

Screen Shot 2014-05-06 at 3.59.30 PM

4. Your MAC will now broadcast the TestPrinting network. On your iOS device, go to Settings->Wifi. You will see ‘TestPrinting’ listed or you can add it from ‘Other’ option. Your iOS device will now be on the TestPrinting network. Connect your MAC to an ethernet cable to make sure that the connection between the MAC and the printer still works.

photo 1 photo 2

5. Go to your app on your iOS device and search for printers. The two shared printers will now show up. Select a printer and give the print command and it should work. You can see the job in the print queue on your MAC as well.

photo 3 Screen Shot 2014-05-06 at 4.10.21 PM