Copy paste text into iOS simulator

2019-03-08 07:08发布

This must be documented somewhere, but I can't find it.

In my app using the iPad simulator there is a textfield into which I want the user to paste text. In the real world the user will copy the text from Safari address into the textfield. But I am trying to do that in the ios ipad simulator, but with only partial results.

After I reRUN the app, I can immediately paste text into the textfield with the Mac's Edit|Paste Text menu or with Shift-Command-V, (but not with just Edit|Paste, but that's Ok). The need for the Shift is annoying but I can live with it.

But then if I try to copy another URL on the Mac and then again, Edit|Paste Text or even use the Paste bubble on the simulator, I don't get the new text, but the original text.

Is that common? Is that a feature of the simulator that it is not connected live to the clipboard on the host computer?

标签: ios clipboard
12条回答
Anthone
2楼-- · 2019-03-08 07:10

I found that even with Edit > Automatically sync pasteboard ticked, the feature didn't work.

However, simply unticking and then reticking this option fixed the feature!

Hope it works for someone.

查看更多
仙女界的扛把子
3楼-- · 2019-03-08 07:10

This works for me. On Safari version 8.0.3 and IOs simulator version 8.1

  1. Copy text from Safari - highlight text then cmd-v or Edit>Copy.
  2. In Ios Simulator click Edit>Paste.
  3. On TextField or TextView right click then select Paste.
查看更多
三岁会撩人
4楼-- · 2019-03-08 07:10

This is what I found.

  1. Copy text from mac.
  2. In simulator open safari and highlight the address bar by clicking it.
  3. Press Cmd + V
  4. Click once on address bar.
  5. Paste drop down shall appear.
  6. Tap on paste.

Shift + Cmd + V works great too.

查看更多
We Are One
5楼-- · 2019-03-08 07:12

Sometimes it's very difficult to type long URLs in iOS simulator. There should be some way to copy URL from Max OS to iOS text field. Here's how you can do it:

  • Copy some text from Mac
  • Open the simulator and click on a text field where you want to paste the text
  • Now in Simulator menu click on Edit -> Paste Text

and that's it. Your text from the Mac OS copy buffer should now be there in iOS simulator's text field.

查看更多
贪生不怕死
6楼-- · 2019-03-08 07:16

In a new emulator, I got no "paste" option and sync did not work for the simulator. It appears that in the simulator you MUST copy something to the internal clipboard before the sync actually works.

查看更多
兄弟一词,经得起流年.
7楼-- · 2019-03-08 07:18

Copy text on the mac, then click the text field in the simulator and press

Shift Command V

查看更多
登录 后发表回答