Xcode6 beta2 不能调试extension问题

问题描述:在用Xcode6 beta2联机调试输入法时出现如下问题
Message from debugger: Terminated due to signal 9

问题分析:查看xcode6 beta2 realse note,发现xcode这版不支持extension的调试
• Debugging Share or Action app extensions does not work in this release. You will see an error
message similar to: "The app on quit unexpectedly. Message
from debugger: Terminated due to signal 9" (17303593)!

PS:重启电脑和真机都无法解决此问题,上午坏了,下午莫名好了,用了一会又坏了

Xcode5下iOS6.1的Tests运行不了

问题描述:在Xcode 5.1.1中用模拟器iOS 6.1跑Tests提示如下错误:

2014-06-18 14:40:49.581 sim[15948:303] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin/sim: Dead bootstrap subset.
2014-06-18 14:40:50.817 sim[15948:303] Error spawning child process: No such file or directory

未找到方法,好歹只有测试跑在iOS6.1跑不了

通知中心推送问题

问题描述:输入法终于转正了,原来通过越狱方式(CFMessagePort)弹通知中心,现在改为App Store版本。这今天试用Baidu Push,遇到如下问题:
2014-06-11 15:35:22.586 PushDemo[756:60b] error:Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的权利字符串" UserInfo=0x15d74ea0 {NSLocalizedDescription=未找到应用程序的“aps-environment”的权利字符串}

问题分析:原因是设备上没有.mobileprovision文件有如下许可的字段:
aps-environment

问题解决:重新生成新的.mobileprovision并安装到设备上

__weak不能使用问题

问题描述:输入法加了一个新类库,报如下错误:

The current deployment target does not support automated __weak references

问题解决

ARC是从4.2以上版本开始支持的,但是不能使用__weak。

从5.0开始支持所有ARC。

在project->info->ios Deployment Target 将target版本改为5.0或者5.0以上。

copy file from iOS(like iFunBox)

昨天浏览器组的同事跑来问了一个没有细想过的问题:没有越狱过的机器怎么通过USB使用脚本批处理iOS设备上的数据。

没有越狱意味着习惯使用的SSH不能用了。
只有使用libimobiledevice了,如下:

1.安装libimobiledevice,ifuse,ifuse依赖与libimobiledevice,
可以选择airport或brew安装
sudo brew update
sudo brew install libimobiledevice
sudo brew install ifuse

2.拷贝osxfusefs.fs 到/Library/Filesystems,并添加执行权限
sudo /bin/cp -RfX /usr/local/Cellar/osxfuse/2.6.2/Library/Filesystems/osxfusefs.fs /Library/Filesystems
sudo chmod +s /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs

3.终端输入ifuse -h,会打印出详细使用说明
挂载某个应用的沙盒到~/myapp:
app_bundleId=com.my.app
udid=xxxxxxxxxxxx
ifuse -u ${udid} --container ${app_bundleId} ~/myapp

4.关闭挂载:
umount ~/myapp

PS:itoos与iexploer等工具都是基于libimobiledevice库进行开发的,iOS 6.x的越狱也用到了此库,更为重要的是appium也依赖于它,如果大家有安装过appium环境那么可以查看下build/libimobiledevice-macosx/,有许多可执行的unix文件
idevice_id
idevicebackup
idevicebackup2
idevicedate
idevicedebugserverproxy
idevicediagnostics
ideviceenterrecovery
ideviceimagemounter
ideviceinfo
idevicepair
ideviceprovision
idevicescreenshot
idevicesyslog
可以直接使用这些命令行工具,例如:
idevice_id -l 可直接查看手机id
idevicediagnostics 可让iPhone进行重启,关机,睡眠等。

我们可以利用libimobiledevice与ifuse进行shell封装,辅助实现自动化的测试过程。

另附上git地址:
https://github.com/libimobiledevice/libimobiledevice‎
https://github.com/libimobiledevice/ifuse