Tap function is working on ios simulator but not on real device i.e. iPad

Hi,
tap function is working on ios simulator but not on real device i.e. iPad
the error is something like 'variable au could not found"

Which library are you using to produce the scripts ?

Could be post more details? Failure log and the code? That would help to figure out the error.

nt),c=gb(b,function(b){return b==a});c||(c=":wdc:"+b.Q++,b[c]=a);return c}\nfunction Fd(a,b){a=decodeURIComponent(a);var c=b||document,d=Gd©;if(!(a in d))throw new Aa(10,“Element does not exist in cache”);var e=d[a];if(“setInterval"in e){if(e.closed)throw delete d[a],new Aa(23,“Window has been closed.”);return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new Aa(10,“Element is no longer attached to the DOM”);};function Hd(a,b){var c=[a],d;try{var e=b?Fd(b.WINDOW):window,f=Ed(c,e.document),g=wd.apply(null,f);d={status:0,value:Cd(g)}}catch(k){d={status:“code"in k?k.code:13,value:{message:k.message}}}c=[];yd(new xd,d,c);return c.join(””)}var Id=[""],$=l;Id[0]in $||!$.execScript||$.execScript("var "+Id[0]);for(var Jd;Id.length&&(Jd=Id.shift());)Id.length||void 0===Hd?$=$[Jd]?$[Jd]:$[Jd]={}:$[Jd]=Hd;; return this..apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);}\n)({“ELEMENT”:":wdc:1409225433067"})",“returnByValue”:true},“id”:11}]
debug: Responding to client with success: {“status”:0,“value”:{“x”:666,“y”:49,“toString”:“function () {return”("+this.x+", “+this.y+”)";}",“ceil”:“function () {this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this;}”,“floor”:“function () {this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this;}”,“round”:“function () {this.x=Math.round(this.x);this.y=Math.round(this.y);return this;}”},“sessionId”:“e447d98f-8fed-4b07-b24b-cb8f74009221”}
debug: Appium request initiated at /wd/hub/session/e447d98f-8fed-4b07-b24b-cb8f74009221/execute
debug: Request received with params: {“args”:[{“duration”:0.1,“y”:49,“x”:666}],“script”:“mobile: tap”}
debug: Pushing command to appium work queue: “au.complexTap({“tapCount”:1,“touchCount”:1,“duration”:0.1,“x”:666,“y”:49})”
debug: Sending command to instruments: au.complexTap({“tapCount”:1,“touchCount”:1,“duration”:0.1,“x”:666,“y”:49})
debug: Sending command to instruments: au.complexTap({“tapCount”:1,“touchCount”:1,“duration”:0.1,“x”:666,“y”:49})

debug: Socket data received (49 bytes)

debug: Socket data being routed.
debug: Got result from instruments: {“status”:17,“value”:“Can’t find variable: au”}

info: <-- POST /wd/hub/session/e447d98f-8fed-4b07-b24b-cb8f74009221/execute 500 890.484 ms - 184

debug: Responding to client with error: {“status”:17,“value”:{“message”:“An error occurred while executing user supplied JavaScript.”,“origValue”:“Can’t find variable: au”},“sessionId”:“e447d98f-8fed-4b07-b24b-cb8f74009221”}

debug: [INST] 2014-08-28 11:30:39 +0000 Error: Error during eval: eval code
eval@[native code]
startProcessing@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/E33443E1-2766-4B32-9D70-1122BE52BFD4/commands.js:120:30
bootstrap@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/092F8445-C4F6-47F5-B90B-FA9A7CC670E6/bootstrap.js:18:29
global code@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/65C0EC93-0BC9-4C9A-87EB-746424ED4C42/bootstrap-fe8fa37a970f98cc.js:9:10

It says can’t find variable ‘au’. Are you sure you are initializing the driver properly?
And why are you doing a complexTap? Won’t a normal tap work for your situation?