Xcode running instruments from commandLine in the actual Device
1) run terminal as Admin (sudo -s).
2) point to the directory where scripts are residing (/users/sj/desktop/scripts/.... etc).
3) Use the full path for the app
4) Run the following command
instruments -w 17cbebfa26acxxxxxxxxxxxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /var/mobile/Applications/A51C31B7-6566-46FB-XXXX-XXXXXXXXXXXX/abc.app -e UIASCRIPT Script1.js
the one next to -w is the UDID of the device
after -t it is the full Path for the instruments (note this might change for different versions of Xcode. the above code works for xcode 5.0.2)
after tracetemplate -- the one starting with /var is the full path of the APP(If you get error like unable to find CFBundleidentifier then specify the full path for the app otheriwse just the app name should suffice without full path)
after UIASCRIPT it is the name of the script.
optional: To specify where to store the trace output(i.e log) please specify the following
-e UIARESULTSPATH fullPath
The above configuration worked for me. Without Admin rights and without running the script from the folder or without specifying the full app path i got the following errors.
1. Argument 'UIASCRIPT' does not point to a valid script. Using script defined in template.
2. Automation Instrument ran into an exception while trying to run the script. UIANoScriptToRun
3. Connection peer refused channel request for "com.apple.instruments.server.services.wireless"; channel canceled <DTXChannel: 0x7fba2b94a7c0>
4.unable to find bundleidentifier for abc.app
Monday, December 23, 2013
Labels:
<DTXChannel: 0x7fba2b94a7c0>,
CFBundleidentifier,
com.apple.instruments.server.services.wireless,
command Line,
commandline,
instruments,
ipad,
iphone,
mac,
sudo,
terminal,
tracetemplate uiascript,
UDID,
xcode
Wednesday, October 30, 2013
adding character to a string Objective-c
char c1=(char)13; char c2=(char)10; char c3='1'; NSString *stringfromchars = [NSString stringWithFormat:@"%@%c%c", @"some string",c1,c2];
Bobby :)
Subscribe to:
Posts (Atom)