Can we test Apple pay in simulator - xcode

I know that Apple pay testing we use Apple pay stubs in iOS 8, but please let me know how to use Apple pay without ApplePayStubs in iOS 9 in simulator.
Thanks in advance

Yes. You can test apple pay using iOS 9 simulator. So you don't need to add any testing sheet instead PKPaymentAuthorizationViewController. It's working on iOS 9 simulator. Make sure your app run on iPhone 6, iPhone 6 plus or latest version of simulator.

In Xcode 12.5 and iOS 14.5 you can do that using
opt + cmd + A

Yes it is working in Simulator with Xcode 7 and iOS 9.
No need for bio metric thumb scanning.
Thanks all

official documentation: https://developer.apple.com/library/archive/ApplePay_Guide/Authorization.html
NOTE
In Xcode 7.0 or later, you can test the payment authorization view
controller in the simulator. It provides simulated cards for all the
supported payment networks and returns dummy payment data in plain
text. On a device, this data is encrypted with your merchant
identifier and must be decrypted either on your server or by your
payment processor.
Use the Apple Pay Sandbox environment to test your app on a device
with test cards.
Although these techniques provide fast and convenient ways to test
your code, you still need to thoroughly test Apple Pay on actual,
physical devices with production cards.

Related

Xcode 13: Build hangs with "iPhone is busy: making Apple Watch ready for development"

Issue: The build hangs with "iPhone is busy: making Apple Watch ready for development"
Further facts:
iOS 14.8
iPhone 8
watchOS 7.6.2
Xcode 13
Apple Watch Series 3 + Cellular (42mm)
Does anyone know a solution for that issue?
Many of the developers have the same issue:
https://developer.apple.com/forums/thread/691452
I have been struggling with this for some time now. If you don't need the Apple Watch, instead of turning it off completely, you can also turn on airplane mode if configured correctly.
On your watch, go to Settings App → Airplane Mode. Make sure that both WIFI and Bluetooth switches are turned off!
When the bluetooth switch is turned on, a connection will still be established even if your watch is in airplane mode AND bluetooth is turned off on the phone from Control Center. It took me some time to figure this out...
Update: The Bluetooth setting seems to turn itself on again after some time! No idea why... 🤷🏼‍♂️ Keep that in mind and check the setting again if flight mode does not fix your issue.
Using Flutter?
When running flutter doctor, it will give you a clear hint, that your watch is causing the issue.
When trying to build your app e.g. from Android Studio, you might instead find these messages in your log:
The requested device could not be found because no available devices matched the request.
Available destinations for the "dev" scheme:
[list of devices]
Could not build the precompiled application for the device.
Building a deployable iOS app requires a selected Development Team with a Provisioning Profile. Please ensure that a Development Team is selected by:
[instructions how to set the development team]
Ineligible destinations for the "dev" scheme:
[list of devices]
I put these messages here for people googling them. If you have an Apple Watch, then run flutter doctor to check if this is the root cause.
This is what works for me:
Turn off the Bluetooth from settings in your iPhone from Settings -> Bluetooth (Don't turn it off from the control center)
Quit Xcode
Launch it again
Build and Run
The solution is:
Waiting for 5-20 mins
Let your iPhone and Apple Watch on
I think all answers are overlooked, you don't need 5-20 mins if you let it finish the preparing process, it'll take just a few minutes, 5 mins top..
But regarding fixing this with an upgrade, that's not the case, and I would love to see it fixed, or offered with an option to exclude watch from the dev purpose unless really needed.
I facing this issue too. This is because the latest xcode only support until iOS 15.2 sdk, but my phone's iOS version is 15.3. Thus, xcode is downloading the iOS 15.3 sdk from your phone that's why takes time (I knew the message is not saying that)
However, I do some testing and it works for me.
Get the iOS 15.3 sdk (is 10BG!!!) from my friend xcode's Devices Support iOS folder /Users/XXX/Library/Developer/Xcode/iOS DeviceSupport and paste it to yours one.
Downloading the iphone OS device support file from https://github.com/filsv/iPhoneOSDeviceSupport/blob/0e8ef7bc51b982304ed3258454f88ae2d5615ac7/15.3.zip unzip it and paste it in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Restart Xcode.
Build success without waiting.
Origin From: https://developer.apple.com/forums/thread/691452?answerId=704424022#704424022
The Apple Watch configuration takes around 5 minutes. It's way better to postpone everything and let it run for 5 minutes then the other workarounds - such as disconnecting your watch, turning on/off your iphone, etc
In my case:
If my Apple Watch is turned on - then from Xcode I'm still able build and run the app just fine.
But when I'm using Flutter - it fails.
flutter devices shows my iphone as "Busy".
As soon as I turn off the Apple Watch, and then disconnect and reconnect the iPhone USB cable - all is good.
Since it's one of the earliest Apple Watch modules, the latest WatchOS that I can install is v6.3, although the latest available is WatchOS v8.x.
I suppose this issue doesn't occur with the latest WatchOS.
(I'm using iOS v15.2)
This still happens from time to time. The solution that has worked for me every time is to reboot the phone
Make sure you're running a version of Xcode that supports the SDK versions of your iOS/watchOS device. If you've recently updated either OS versions, you may need a matching Xcode update for this to work properly.
The real solution is:
If you don't need the apple watch you can just power off the Apple Watch and unplug/plug the iPhone. That's a quick fix. No need to unpair the watch no need to wait 5 - 20 mins
According to this post, this issue is fixed with an upgrade to iOS 15.0.2 / watchOS 8.0.1: https://developer.apple.com/forums/thread/691452

XCode / iOS : how to test with XCode (on a real device) an app developed by another developer?

I work with another developer. I would like to test its app but I don't have its iTunes Connect login / password and I don't have its dev certificates.
How can I test on my real device the bundle he sent to me without having many signing errors ?
I want to perform the test in Xcode in order to be able to use the debugger and perform some code modifications. I do not need to test the inapp purchase, just the core features of the app.
It is possible to resign the app with your own certificates. See this answer
You can also use XCode7 Beta, it allows you to install any apps they develop on their devices without an Apple Developer Program Certificate.

How can I test app on older iPhone 3G with iOS v 4.2.1

I have been testing my app on my iPhone 4S and my wife's iPhone 3GS. I would also like to test it on the older iPhone 3G running iOS 4.2.1 (the highest version it will support).
When I connect the 3G to my Mac and attempt to provision it, I get two error messages:
Could Not Support Development
and
Xcode cannot find the software image to install this version
I am using the latest version of xCode (v. 4.4.1).
Is there some place to find the missing 'software image' in order to test my app on the 3G and older iOS devices?
If not, how does one know what devices the app will work with?
I do note that the newer iPhones that run iOS5 and above also support Automatic Reference Counting (ARC). I have checked the ARC button whenever I created a new project. Does one have to abandon ARC if one wants their app to work on an older pre iOS5-capable device?
...Dale
Is there some place to find the missing 'software image'?
I believe you can download it through iTunes by clicking restore in the device's summary page and then searching for the *.ipsw file. iTunes might even share the image once it is downloaded automatically.
Does one have to abandon ARC if one wants their app to work on an
older pre iOS5-capable device?
Not in entirety. iOS 4.2 supports the vast majority of ARC, But it does not support weak references.
Also, there are a few hoops you must jump through to target. I have an answer here that outlines them (with screenshots).
I know for a fact that Xcode 4.4.1 can use an iOS 4.2.1 device as a target, since I can test on a second generation iPod touch running 4.2.1.
Finally, If you are not able to obtain a software image, you could try adding your device by UDID directly on the provisioning portal through developer.apple.com.(The old fashioned way)

Do I need an Apple Developer account? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I am newbie in Xcode and Mac. I can make programs working well on simulators but cant make dmg files . Somewhere I heard I need an Apple Developer account ( 99$) for that but I dont want to publish my file on App store. I just need to install it on 1 or 2 other Macs.
With Xcode 7 you are no longer required to have a developer account in order to test your apps on your Mac and/or iOS device:
Check it out here.
Please notice that this is the officially supported by Apple, but you'll have to use Xcode 7 or later and your iCloud account.
Before going on - You CAN develop iOS apps and deploy to device from Xcode without developer account, but as far as I know it can be done only on jailbroken devices.
Check this link for more info.
UPDATE
sorry, I thought you meant developing for mobile. check this video about Creation of .dmg files for more information.
ORIGINAL ANSWER
Have a look at the apple developers page to see the different account types. Specifically, the free account:
If you're not ready to join one of our developer programs, you can register as an Apple Developer for free. As a registered Apple Developer you gain access to development tools, resources and information to assist you in creating apps for iOS and OS X. Learn more
With the free account you could run your app on any mac OS as well as on an iPhone connected to the mac OS.
With the paid account you could install the app on any provisioning device and submit the app to the store.
If you are developing for the mac and you are not going to publish on mac app store, you do not need a developer account.
You do need an account for any of the following:
Install an app on an iOS device (even your own one for debugging)
Publish an app on any of the app stores (either iOS or Mac)
Edit: note that if you do not have an account, your Os X applications will be unsigned. They'll work, but each of your users will get a warning and will need to lower the security settings of his Mac in order to be able to run the application (or, at least, he'll have to approve each application specifically).
You need Developer account for developing and debugging application on device. Of course, there are several ways to do that without this account... Have a look:
http://www.alexwhittemore.com/developing-jailbroken-iphone-ios-401/
You don't need an Apple developer account to make apps, but if you want to put them on the App Store, gain access to developer beta release software and forums, then yes you do.
You can develop Mac applications without a membership, but if you want to develop iOS applications, you need a membership to run your app on any device.
If you want to run your iOS app in the iOS Simulator, though, you don't need a membership. You can install Xcode and the iOS Simulator on any Mac running 10.7 Lion or later.
Maybe you want to use the Simulator binaries on other Macs without having to compile the app on the other Macs, then you should have a look at that tool: https://github.com/landonf/simlaunch

Location services are not functional in iOS 4.3 simulator running on Mac OS 10.7 with Xcode 4.2

I have built an iOS app that leverages Core Location Framework. I have Xcode 4.2 installed and Lion and now Location services are not functional.
Anyone know if there is a patch or workaround for this? I basically stuck and can't test my app on the simulator.
The updated location services in the iOS Simulator are not available to the general public as of yet. If you have access to the iOS Developer Program, you can download the latest beta of XCode, 4.2, and test that way.
As a warning, the beta is just that, a beta. You may end up with more testing issues that are completely unrelated to your location services.
Best case scenario is 2 machines, one for each. That isn't always feasible, so you'll have to decide which is more important. Good luck.
Testing on the device would definitely be a good work around. You will want to test on a real device to check Xcode 4.2 is still in Beta, so this might be a bug in this latest version. According to the documentation it is supposed give you the latitude and longitude of the Apple headquarters as a default.
iOS Simulator notes

Resources