简体   繁体   中英

Simulate Sending an SMS to the iPhone Simulator in Xcode

Is there a way in xcode to simulate sending an sms to the iPhone simulator?

I don't need to actually send a real SMS. I just need to look at how the message body displays in a bunch of different versions of iOS.

I know Android Studio allows you to do this very easily, and I was wondering if there was a similar solution for iOS development.

No, you can't.

There is also no SMS application (Message app) installed in the simulator.

If you just need some notification displayed in your simulator, you can try to schedule a local notification from your app that is running under that simulator. You can find many tutorial online, like this: https://medium.com/@dkw5877/local-notifications-in-ios-156a03b81ceb

you can. At least in iOS 11.4 and higher versions. The Messages app has two contacts, and they are linked in a loopback fashion - sending a message as Kate will arrive in the John contact, and vice versa.

  1. open simulator.
  2. open messages App在此处输入图片说明
  3. select one of two contacts in it在此处输入图片说明
  4. send them sms though the simulator UI在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM