Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBM Worklight - "Permission denied" when building in Xcode

I created and built a Worklight project following the official guide on developerWorks. I deployed the app on Android device and it worked fine. But when I built the generated native project with Xcode, I got the following error:

Running a custom build phase script: buildtime.sh /Users/gengsm/Documents/workspace/MobileClientMobileBankIphone-apsfwvobsizahnbjzlwhgbsbwusj/Build/Intermediates/MobileClientMobileBankIphone.build/Debug-iphonesimulator/MobileClientMobileBankIphone.build/Script-427B829D1393724500F223DC.sh: line 7: /Users/gengsm/Documents/workspace/BTT_Mobile/MobileClient/apps/MobileBank/iphone/native/buildtime.sh: Permission denied DONE with script: buildtime.sh (exitStatus=126)\n\n

like image 257
user2985919 Avatar asked Nov 13 '13 03:11

user2985919


1 Answers

This is probably a Worklight project that was created in Windows and then the generated Xcode project was moved to Mac to be built in Xcode...

The problem here is that the buildtime.sh file lost its Execute permission.
This defect is fixed and will be available in Worklight 6.1.0, available in the coming weeks.

Solutions:

  • Assuming you have brought the generated Xcode project from Windows to Mac:

    1. Extract the zipped project
    2. find in it the buildtime.sh file
    3. Right-click it > Get Info
    4. At the bottom change the Owner permission to Read & Write

  • If that doesn't work, you can also change the permission using CHMOD:

    1. Copy the path to the folder holding the buildtime.sh file
    2. Open the Terminal app
    3. Run the following command (but use your own path from 1 above): chmod 755 /Users/idan/Documents/Worklight/workspace-6001/TestProject/apps/TestApp/iphone/native/buildtime.sh

  • If you have the entire Worklight project in Mac, then in Eclipse:

    1. Right-click the iphone\native\buildtime.sh file > properties
    2. Add the Execute permission for Owner
    3. Re-build to generate an updated Xcode project
    4. Open in Xcode > Run

You can also:

  • Create the Worklight project to begin with, in Eclipse in Mac.
    This project should not exhibit this issue then.
like image 64
Idan Adar Avatar answered Nov 02 '22 00:11

Idan Adar