简体   繁体   English

在Xcode Simulator中使用USB设备

[英]Using a USB device with Xcode Simulator

So, I have this scanner device that scans barcodes. 因此,我有这台扫描条形码的扫描仪设备。 I want it to connect through the USB. 我希望它通过USB连接。 I'm not sure how to get the data from the device once it gets scanned. 我不确定扫描后如何从设备获取数据。 I know it records the barcode info in hexadecimal, so when the data arrives to the application, some conversion will have to take place. 我知道它以十六进制形式记录条形码信息,因此,当数据到达应用程序时,必须进行一些转换。 But, I'm still very confused on how to actually digitally connect and communicate with the device. 但是,我仍然对如何实际进行数字连接和与设备通信感到非常困惑。

I saw online to try and use IOKit.framework, but I believe it's for MAC, which I'm not using. 我在网上看到了尝试使用IOKit.framework的信息,但我相信它是针对MAC的,我没有使用过。 I'm trying to do it through iOS in the iPhone simulator. 我正在尝试通过iPhone模拟器中的iOS来实现。

I also have a command list of hexadecimal commands I can send to the device, However, I don't know how to actually send the message to the device. 我还有一个可以发送到设备的十六进制命令的命令列表,但是,我不知道如何实际将消息发送到设备。

Apologies if I was a little repetitive. 抱歉,如果我有点重复。 Thanks in advance! 提前致谢!

You can't. 你不能

iOS Simulator has no access whatsoever to any USB device connected to the Mac. iOS Simulator无法访问连接到Mac的任何USB设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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