13

I can successfully open the serial port of iPhone/iPad in lower version than iOs 5. with the use of

open("/dev/tty.iap", O_RDWR | O_NOCTTY | O_ASYNC))

but i got error "Operation not permitted" in iOS 5 .

(I used the Serial Programming for communicating accessory and iPhone)

Is there any one have idea about this.

Thanks.

Community
  • 1
  • 1
Raj
  • 1,213
  • 2
  • 16
  • 34
  • Is this on a jailbroken device? You shouldn't have direct access to the `/dev` portion of the filesystem from outside of the sandbox of an iOS application under normal circumstances. – Brad Larson Dec 21 '11 at 20:45
  • Yaa its jailbroken device. but i am not able to access /dev in iOS 5 – Raj Dec 22 '11 at 05:52
  • @Raj: Did you end up fixing this? I am also getting the "Operation not permitted" error when trying to open /dev/tty.iap on a jailbroken iPod Touch running iOS 5.0. – newenglander Apr 28 '12 at 18:12

3 Answers3

2

Since it also doesn't work for me I think Apple blocked serial access on iOS5+. Stefan Esser (@i0n1c on twitter) just had a talk about this at a security conference. I'm waiting for the slides so then we know what happened to serial

0

I got the same error and was able to solve it by putting the app in the directory where Cydia apps go rather than where Xcode automatically puts it (Found this hint in the second link in this related/identical post).

Community
  • 1
  • 1
newenglander
  • 2,019
  • 24
  • 55
0

Not sure if you got this working, but from what I have read you can not access the iPhone's serial port for communication while your app is in the sandbox. By sandbox, I mean when you click "run" in Xcode and transfer your app to your iDevice the app lives in a sandbox environment. This environment prohibits your app from accessing things such /dev/tty.iap the serial port within the dock connector. One solution I have read is to copy your app /Applications/which is a link to the location /var/stash/Applications.XXXXXX/ which should take your app out the sandbox environment, and give it access to /dev/tty.iap Let me know if this works for you as this is something I am eventually going to have to do with the app I am developing.

ipatch
  • 3,933
  • 8
  • 60
  • 99