+ //sh-3.2# dotnettool --rm-app-profile [pkgId] [pkgId] ...
+ else if (cmd == "--rm-app-profile") {
+ if (args.size() < 1) {
+ fprintf(stderr, "Package name is missing\n");
+ }
+ while (it != args.end()) {
+ std::string pkg = std::string(*it);
+ setenv("AUL_APPID", pkg.c_str(), 1);
+ char *localDataPath = app_get_data_path(); // /root/apps_rw/<app_id>/data/
+ if (localDataPath != NULL) {
+ char *home = getenv("HOME"); // /root
+ std::string rmCMD = std::string("rm -f /home/*");
+ rmCMD.append(localDataPath + strlen(home)); // rm /home/*/apps_rw/<app_id>/data/
+ rmCMD.append(PROFILE_BASENAME); // rm /home/*/apps_rw/<app_id>/data/.__tizen_specific_profile_data
+ system(rmCMD.c_str());
+ free(localDataPath);
+ } else {
+ fprintf(stderr, "Application not found [%s], skip to remove profile\n", pkg.c_str());
+ }
+ it = args.erase(it);
+ }
+ }