直接在命令行上执行,可以看到程序已经跑起来了,但是GUI上没有任何输出…
JerrysPhone:/home/jerry root# /var/mobile/Applications/39809BB6-96CE-4DE5-8701-44B3AB7738D2/tdbeta.app/tdbeta
2013-12-24 15:43:59.309 tdbeta[1728:707] -> registered mono modules 0xf9b580
^C
可以用open命令来启动:com.conradkramer.open
例如启动计算器:
JerrysPhone:~ root# open com.apple.calculator
那么怎么启动别的程序呢?例如这个tdbeta,可以从该程序的Entitlements里获取到这个com.xxx.yyy的信息:
JerrysPhone:~ root# ldid -e /var/mobile/Applications/39809BB6-96CE-4DE5-8701-44B3AB7738D2/tdbeta.app/tdbeta
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>application-identifier</key>
<string>58T7J9EDS7.com.luckoo.tdbeta</string>
这个58T7J9EDS7是干什么用的还不清楚,用open调用的时候要删掉这个
JerrysPhone:~ root# open 58T7J9EDS7.com.luckoo.tdbeta
Couldn’t open application: 58T7J9EDS7.com.luckoo.tdbeta. Reason: 7, application not found
JerrysPhone:~ root# open com.luckoo.tdbeta
这个open项目位于:
https://github.com/conradev/Open/blob/master/control
git clone https://github.com/conradev/Open.git
从代码上来看,其实就是调用了SpringBoard的一个API函数:
extern int SBSLaunchApplicationWithIdentifier(CFStringRef identifier, Boolean suspended);
JerrysPhone:~ root# otool -L /usr/bin/open
/usr/bin/open:
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 993.0.0)
/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 793.0.0)
/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 173.8.0)
但这种open的启动方法,并不能实现stdout的重定向,例如启动tdbeta时无法看到
2013-12-24 15:43:59.309 tdbeta[1728:707] -> registered mono modules 0xf9b580