You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add ability to enable/disable AssistiveTouch soft "home" button. iOS 11+
Using the same technique already used for querying and setting the device language and locale, go-ios can now enable and disable AssistiveTouch using the the magic boolean com.apple.Accessibility.AssistiveTouchEnabledByiTunes
This commit slightly modifies the existing SetValueForDomain() and related methods and structs to take an interface{} value (rather than a string) in order to pass a raw bool to lockdown.
This commit also replaces a few inconsistently used tabs in the verbose command-line "help" output.
Thank you to the team at alibaba/taobao-iphone-device (tidevice) for sharing the magic word to make this happen.
Validated on iPhone 5s, 6, 6s, 6s plus, 7, 8, se 1st gen, se 2nd gen, and 11 pro max. iOS 11.4.1, 12.1, 12.5.5, 13.4, 13.6, 14.0.1, 14.7, 15.0, 15.3, and 16.0.1 beta.
Failed on an iPhone 6+ running iOS 10.2.1 (Exits with error including hint: “Is this device running iOS 11+?”)
* Add iOS11+ version check to "assistivetouch" command, with --force override to attempt anyway.
Having tested on a grand total of 1 iOS10.x device (an iPhone 6s plus), we speculate that the technique used to enable/disable assistive touch does not work on devices older than iOS 11. This commit adds a fail-fast check for versions older than iOS 11.
However, since only 1 device has been tested, (and older iPad OS has not been tested at all), I have also added a "--force" override so that the end-user can still give it a try.
The "--force" option also forces SetValue() to be called even if it would not cause an apparent change. (By default, if assistive touch is already disabled, and the user asks to disable it, nothing happens).
"--force" is mostly meant as a way to continue testing older device functionality without having to have a custom debug build of go-ios. If we can definitively prove that iOS12 is the minimum, the --force option can be removed.
Co-authored-by: danielpaulus <[email protected]>
// In testing, nil was returned in only one case, on an iOS 14.7 device that should already have been paired.
39
+
// Calling SetAssistiveTouch() directly returned the somewhat more useful error: SetProhibited
40
+
// After re-running "go-ios pair", full functionality returned.
41
+
returnfalse, fmt.Errorf("Received null response when querying %s.%s. Try re-pairing the device.", accessibilityDomain, assistiveTouchKey)
42
+
}
43
+
enabledUint64, ok:=enabledIntf.(uint64)
44
+
if!ok {
45
+
// On iOS 10.x at least, "false" is returned, perhaps for any key at all. Attempting to manipulate AssistiveTouchEnabledByiTunes had no effect
46
+
returnfalse, fmt.Errorf("Expected unit64 0 or 1 when querying %s.%s, but received %T:%+v. Is this device running iOS 11+?", accessibilityDomain, assistiveTouchKey, enabledIntf, enabledIntf)
47
+
} elseifenabledUint64!=0&&enabledUint64!=1{
48
+
// So far this has never happened
49
+
returnfalse, fmt.Errorf("Expected a value of 0 or 1 for %s.%s, received %d instead!", accessibilityDomain, assistiveTouchKey, enabledUint64)
@@ -186,9 +187,10 @@ The commands work as following:
186
187
ios reboot [options] Reboot the given device
187
188
ios -h | --help Prints this screen.
188
189
ios --version | version [options] Prints the version
189
-
ios setlocation [options] [--lat=<lat>] [--lon=<lon>] Updates the location of the device to the provided by latitude and longitude coordinates. Example: setlocation --lat=40.730610 --lon=-73.935242
190
-
ios setlocationgpx [options] [--gpxfilepath=<gpxfilepath>] Updates the location of the device based on the data in a GPX file. Example: setlocationgpx --gpxfilepath=/home/username/location.gpx
191
-
ios resetlocation [options] Resets the location of the device to the actual one
190
+
ios setlocation [options] [--lat=<lat>] [--lon=<lon>] Updates the location of the device to the provided by latitude and longitude coordinates. Example: setlocation --lat=40.730610 --lon=-73.935242
191
+
ios setlocationgpx [options] [--gpxfilepath=<gpxfilepath>] Updates the location of the device based on the data in a GPX file. Example: setlocationgpx --gpxfilepath=/home/username/location.gpx
192
+
ios resetlocation [options] Resets the location of the device to the actual one
193
+
ios assistivetouch (enable | disable | toggle | get) [--force] [options] Enables, disables, toggles, or returns the state of the "AssistiveTouch" software home-screen button. iOS 11+ only (Use --force to try on older versions).
192
194
193
195
`, version)
194
196
arguments, err:=docopt.ParseDoc(usage)
@@ -328,6 +330,29 @@ The commands work as following:
0 commit comments