How to send a touch event to iPhone OS? [duplicate] - iphone

This question already has an answer here:
Is possible to simulate touch event using an external keyboard on ios jailbroken?
(1 answer)
Closed 2 years ago.
Im writing an app running in background on a jailbreak iphone. I need to send touch event to iPhone OS to simulate finger touches. Is this possible?

See Matt Gallagher's article "Synthesizing a touch event on the iPhone". You may also check out the Three20 framework, which I believe used synthesized touch events to test UI elements (leading to a rash of recent application rejections due to the use of private APIs).

Yes it is possible, using GSEvents. Try the KennyTM's private framework and GSEvent.h. It is under the GraphicServices framework.
https://github.com/kennytm/iphone-private-frameworks

Related

How can I simulate the touch events by IOHIDEvent?

I want to simulate touch events on iOS 6. I learned something useful from IOHIDEvent, which is a low-level functions bundle for human interface devices.
From: https://github.com/kennytm/iphone-private-frameworks/tree/master/IOKit/hid I got the private framework with IOHIDEvent, but the headers were changed after iOS 4, and some functions were not supported any more.
Does anyone know how to get the functions in iOS6, or known how to simulate the events at system-level?
As I mentioned in my answer to your other question today, you might try looking at GSEvent.h from GraphicsServices.framework, or in IOKit.framework.
Here are some good answers on stackoverflow to help you:
iOS Private API: lock device and power off the screen
GSSendEvent - Inject Touch Event iOS
iOS touch event notifications (private API)
May be UIAutomation helps you http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/UIAutomationRef/_index.html ?
Or UISpec: http://code.google.com/p/uispec/wiki/Documentation
If you want to simulate touch events at the system level, you have to jailbreak your device.
Check this:
Simulate Touch Event on iOS - jailbroken - iOS13+
Is possible to simulate touch event using an external keyboard on ios jailbroken?

How to capture and record iOS Touch Events at system level?

I want to capture all the touch events at the system level, I do not mean capturing at one specified app, but all the apps even the SpringBoard.I tried IOHIDEvent(https://github.com/kennytm/iphone-private-frameworks/tree/master/IOKit/hid), but the runtime headers was changed after iOS4, and now I can not get them of iOS6.
May be GSEvent is also a good way, but does anyone known how to do this by GSEvent?
Thank you!
Take a look at EntryDevLevel excellent answer here on how to capture and record clicks on iOS using iOHID:
iOS touch event notifications (private API)
BTW. His solution works on non jailbroken iOS either.

turn off device volume - iOS [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Mute/Silence an iOS device programmatically?
I need to turn off the device volume programmatically. Does anyone know a way?
So far I have discovered, that maybe i can use AudioSessionSetProperty() function, and use the property "kAudioSessionProperty_CurrentHardwareOutputVolume",
but this property is only read only. SO i am not sure if this will work:
float value = 0.0f;
AudioSessionSetProperty(kAudioSessionProperty_CurrentHardwareOutputVolume, sizeof(float), &value);
There are already apps in the App-Store that does this, e.g. AutoSilent:
http://itunes.apple.com/nl/app/autosilent/id474777148?mt=8
You can't do this with iOS. The only way to mute an iOS device is by using the hardware switch. You can detect it and mute your app accordingly, but can't mute the entire device from your app.
See this question: How to disable iOS System Sounds
And this question: Mute/Silence an iOS device programmatically?
They say there that it is possible though you have to use a private framework called the Celestial framework. You would use AVSystemController to silence the phone like so:
[[AVSystemController sharedAVSystemController] setVolumeTo:0 forCategory:#"Ringtone"];
The use of private frameworks in your app will cause it to be rejected by apple, so I don't recommend using it. Some believe that using private frameworks in your app could potentially be allowed by Apple initially (if they miss it), but it will soon be removed from the App Store when they realize that you are utilizing a private framework.
Hope this helps!

Using iPhone default Alarm sounds in application [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Play alert sound (same as default message ringtone)
Hello all,
Quick question -
Is it possible to use one of the default sounds included on the iPhone - Marimba etc. in an iPhone application?
Thanks,
Teja
The actual directories will only be accessible after JailBreak.
Ringtones (including Marimba):
/Library/Ringtones/
System sounds:
/System/Library/Audio/UISounds/
Or use 'AudioServicesPlaySystemSound()' like mentioned by Black Frog.
Note: This method is undocumented and will cause AppStore rejection.
Download link for system sounds (comment by clusterfu_k):
Can I get default audio files of Iphone (marimba, alarm, ascending,...)?
Note: Possible copyright infringement.

iPhone (iOS4): Can I get the phone number of a phone call read to an application (similar to Mr.Number)? [duplicate]

This question already has answers here:
Checking incoming call in iphone
(4 answers)
Closed 7 years ago.
If the application is running in the background, can it save the phone numbers of received calls using CoreTelephony (or similar library)? Is it possible to listen to the incoming call event and make a callback passing data to my application?
CTCallCenter.h seems to have a currentCalls property, but I can't find a description of it. Anybody know if it has phone numbers in it?
Application called "Mr.Number" seems to have a similar feature, but it's not available outside of the US so I can't get it to check the exact functionality.
This seems to be related to Checking incoming call in iphone
Currently no.
There are lots of problems:
CTCallCenter call tracking does NOT give you the phone number of the call.
Call tracking does not really work in the background (it works while you have a background task, but once that finish the app will not get any call CTCallCenter call-backs).
currentCalls is a list of all current calls at that point in time and no they don't give you the phone number.
I looked into "Mr.Number" application to see if it actually does support such features. It doesn't track phone calls at all. I found this quote from their blog:
While we’re on the subject, we get a
lot of questions about why our iPhone
app doesn’t have all the functionality
of our Android and BlackBerry
versions. We hear you. We’d love to
offer call blocking, true caller ID,
or at the very least the ability to
look up numbers from your recent calls
without having to copy and paste them
from your call log into Mr. Number.
Unfortunately, none of this is
possible on the iPhone today without
jailbreaking. When Apple gives us APIs
to do so, we promise to bring all the
features of our Android and BlackBerry
apps to iPhone