I am automating Apple Watch ui testing and currently I stuck with the problem interacting with Apple Watch Home Screen (e.g. tap, press, scroll, etc.)
I know that testing is happening in the sandbox of the app under test, but I need to interact with the elements on Home Screen when the app under test is running on the background.
I know that Appium does similar thing to iPhone's Home Screen via "com.apple.springboard" which is the app, that manages iPhone's Home Screen, but what about Apple Watch? Is there a way I can interact with Apple Watch Home Screen?
Per the other question you have open regarding the iOS home screen, the watch can be interacted with the following bundle identifiers:
com.apple.BackBoard, com.apple.BaseBoardUI, com.apple.PreBoard, and com.apple.ReBoard.
The following debug command should show you what's available for interaction:
po XCUIApplication(bundleIdentifer: "oneOfThoseBundleIDs")
Related
I was told multiple times that other apps do this but I can't seem to find any documentation on how to do that.
The behavior I would like to achieve is:
User starts iOS app and navigates to particular screen.
User presses start action/workout button and starts action/workout on iOS app.
At the same time user's Watch wakes up and shows corresponding screen in Watch app which acts as info screen for the current action/workout in iOS app.
User can press pause button on Watch and pause the action/workout in iOS app (this part is working already via WCSession).
So the question is basically how can I launch Watch app when either iOS app starts or when user does something in iOS app?
P.S. It is not a question of launching iOS app from Watch app, AFAIK for that I can use handoff.
I have searched for this answer for quite a while with no luck. Is it currently possible to remove the appstore from an iPhone?
No, it is not possible. Even on company controlled devices the App Store will still be present. Using MDM (Mobile Device Management) you can control a lot about the phone, but the App Store is still present.
Remove built-in Apple apps from the Home screen on your iOS 10 device or Apple Watch
With iOS 10, you can remove some built-in Apple apps from the Home screen on your iPhone, iPad, iPod touch, or Apple Watch.
When you remove a built-in app from your Home screen, you also remove any related user data and configuration files. This can affect things like related system functions or information on your Apple Watch.
The apps built into iOS are designed to be very space efficient, so all of them together use less than 200MB. Removing built-in iOS apps doesn't free up storage space on your device.
Built-in apps you can remove from your Home screen
If you have iOS 10, you can remove these apps from your Home screen:
Calculator
Calendar
Compass
Contacts1
FaceTime2
Find My Friends
Home
iBooks3
iCloud Drive
iTunes Store
Mail
Maps3
Music3
News (where available)
Notes
Podcasts3
Reminders
Stocks
Tips
Videos or TV
Voice Memos
Watch app4
Weather
If you remove the Contacts app, all of your contact information will remain in the Phone app.
If you remove the FaceTime app, you can still make and receive FaceTime calls in Contacts and the Phone app.
If you remove the iBooks, Maps, Music, or Podcast apps, they won’t be available to use with CarPlay.
If you try to remove the Watch app from an iPhone that’s paired with an Apple Watch, an alert asks you to unpair your Apple Watch before you can remove the app.
Remove a built-in app from your Home screen
On your iOS device, touch and hold the app lightly until it jiggles. If the app doesn't jiggle, make sure that you're not pressing too hard.
Tap Remove on the app, then tap Remove.
Press the Home button to finish.
If you have an Apple Watch, removing an app from your iPhone also removes that app from your Apple Watch.
Restore a built-in app that you removed
On your iOS device, go to the App Store.
Search for the app. Make sure that you use the exact name of the app. Find the correct name of built-in apps.
Tap to restore the app.
Wait for the app to restore, then open it from your Home screen.
If you have an Apple Watch, restoring an app to your iPhone also restores that app to your Apple Watch.
What happens when you remove built-in apps from your Home screen
Removing built-in apps from your Home screen can affect other system functionalities. Here are some examples:
If you have an Apple Watch paired with your iPhone, removing an app from your iPhone Home screen also removes that app from your Apple Watch Home screen.
If you remove the Podcasts app from your Home screen, Podcasts won’t be available with CarPlay.
If you remove the Music app, you may be unable to play some audio content using Apple apps or third-party apps on some car stereos or stereo receivers.
If you remove the Stocks or Weather app from your Home screen, stocks and weather won’t be available elsewhere. For example, you won’t see stocks and weather information in Notification Center on your iPhone or as Complications or Glances on your Apple Watch.
If you remove the Calculator app, the calculator won’t appear in Control Center.
I am currently prototyping an iOS iPad app for my company. Before I go in the details of what I am trying to do, this will be an enterprise app deployed by a local MDM. All the iPads that will have the app installed are supervised with a mobile config that allows the app to be in autonomous single app mode. So far, everything is working fine. The iPads are not (and cannot) be jailbroken.
I am looking for a way to basically switch the app to the foreground whenever the iPad is unlocked. I am aware of this thread (ios open app after screen unlock) from 2013, and I am hoping that 5 years later a solution has popped-up. Since our app is an enterprise app, it does not have to respect the app store requirements. I can successfully detect lock events if the app is opened when the device is locked, but when the app is not in the foreground, I would need it to be awaken from an iPad event.
The basic idea is that whenever the iPad would be unlocked, the app would freeze the iPad in single app mode, and the user need to perform some action inside the app to "reenable" the iPad and disable single app mode. If a user can re-lock the iPad and bypass the app (even if he successfully accessed it once) it's a no-go for us.
Edit
I am trying to awake the app after the unlock of the device. Basically once the iPads is unlocked (after pressing the home button) the app would be started automatically.
That is a loaded question but you could lock the ipad to only use one application with "Guided Access" There is a walkthrough here.
Here are the first steps:
Open “Settings”
Go to “General” > “Accessibility”
Tap on “Guided Access” (Scroll down the page a little, it’s under
the “Learning” section)
Flip the switch to “ON”
Tap on “Set Passcode” (this will prevent
users from leaving “Guided Access” mode)
Enter a passcode
Launch your App
With your app still open, triple-click the Home button
Is the iPhone "device Home button" (circle button that is part of the hardware at bottom center) the standard way that users exit an iPhone app?
I don't have an actual iPhone device yet (looking for the iPhone6 to come down in price a bit), am just working with Xcode simulators. When I run my iPhone Swift apps, they are always in full screen mode.
On Android, there are a few navigation buttons built into the OS that appear at the bottom of the screen - Back, Home, Open Apps. And in that OS you can give a directive to exit full screen to reveal those OS buttons.. which then allows the user to easily exit the app if they'd like to.
In looking at the iPhone apps on the simulator, I notice they don't have this kind of UX.
What are the best practices around iPhone users
A. Sending an app to the background ?
B. Quitting/Closing an app ?
To send an app to the background, hitting the home button is sufficient.
To quit an app, tapping the home button twice shows you all the open apps; you can then swipe an app to "kill" (terminate) it.
However, here is a recent post by the excellent John Gruber explaining why killing an app should only be a last resort: https://daringfireball.net/2017/07/you_should_not_force_quit_apps
Note: on the iPhone Simulator, the command-shift-H key combo is equivalent to hitting the home button.
To send an app to the background:
Press the Home button.
To "quit" or "close" an app:
Press the Home button.
That's all the UX expected of an iOS app... and none if it is actually provided by your app. iOS manages it for you; you just have to deal with your app's lifecycle methods to respond to the user leaving and re-entering your app.
iOS doesn't expect users to know or care about the difference between "background" and "closed/quit" in most cases. You enter an app, you leave an app, that's it.
And the way iOS works under the hood, there is no difference in most cases — when you leave an app, it's not "running in the background", it's "frozen" or "suspended": that is, in memory but not running. That way the OS can get it usable again near-instantly if the user comes back, or instantly reclaim that memory if another process needs it.
The user can also invoke the multitasking UI (double click home button, or in iOS 11 on iPad swipe up from bottom edge) and swipe an app away, but this is equivalent to the "kill" or "force quit" actions seen in other operating systems — it's primarily for situations where an app is misbehaving. This isn't part of your app's UX either; it's also provided by iOS.
As noted in the Daring Fireball post linked from #TimKokesh's answer, there are some circumstances where an app "in the background" isn't "frozen" but has some limited ability to run, the Settings app has UI to help the user keep tabs on what are using (and abusing) that ability, and those are some of the only cases where it's reasonable for a user to "force quit" apps.
If you want to have a real iPhone look-alike simulator on your development environment, yes it's available with New Xcode-9/Beta version. It shows real hardware buttons(volume, lock, home buttons) which you can press and feel like a real device. If you are interested you can download it from here
On other Xcode environments, you can go to home screen by pressing the keys: Cmd + Shift + H
I noticed recently a banner notification on my iPhone I haven't seen before. I can't find description of these banners, for example here. Here they are:
First of them appears when an app goes in background. Tap on the banner shows the app again.
The second appears when I create a Hotspot and tap on it shows Hotspot settings.
So, my questions are:
What are these banners?
Why they have different colors?
How can I create the same banner in my own app?
The blue banner is there if the "personal hotspot" feature is turned on, and some other device is using the shared internet connection.
The red banner is shown for example if an app that is not currently in the foreground is accessing the microphone.
Both banners are provided by the operating system and are not customizable by app developers. These banners can sometimes make problems when your app is not prepared to re-layout its views as a result of this banner appearing or disappearing. Therefore, you can simulate this banner in the iOS-simulator by pressing CMD-Y (XCode6 iOS Simulator => Hardware => Toggle In-Call Status Bar).
Furthermore, these banners are not really "notifications", they are more like status hints that provide a visual cue to the user that the phone is in an exceptional state (red=microphone access, green=a phone call is in progress, blue=personal hotspot is in use.)